Unable to find batch file - InfoPath Dev
in

InfoPath Dev

Unable to find batch file

Last post 02-27-2012 06:57 AM by ek38. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 02-14-2012 06:00 AM

    • ek38
    • Top 200 Contributor
    • Joined on 02-14-2006
    • Posts 54

    Unable to find batch file

    We have an infopath form with a button.  When the user clicks the button, code is executed.  It simply runs a file located on the "C" drive 

    objShell.ShellExecute("ListShipDocsToBeImported.cmd");

     Often, the user will get a message "Windows cannot find ListShipDocsToBeImported.cmd.  Make sure you typed the name correctly and try again."

     

    The users work around is to reboot the computer and then it will work.  The form is located in a directory called C:\aoe.  The cmd file is also located in the same directory.

    Filed under:
  • 02-15-2012 11:18 AM In reply to

    Re: Unable to find batch file

    Have you tried including the file as a resource of the template instead and then referring that file in code?  Go to Data tab -> Resource Files.
    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 02-20-2012 07:57 AM In reply to

    • ek38
    • Top 200 Contributor
    • Joined on 02-14-2006
    • Posts 54

    Re: Unable to find batch file

    Anson,

    No I have not.  To be honest, I never have used that feature of Infopath.  I will read-up and give it a try.

     Thanks

    Filed under:
  • 02-21-2012 07:36 AM In reply to

    • ek38
    • Top 200 Contributor
    • Joined on 02-14-2006
    • Posts 54

    execute a resource file form code?

    I want to call a ".bat" file or a ".cmd" file located on the local C drive from within an infopath form.  It was suggested I add the file as a "resource" file, which I did.  Now, how do I execute that resource file within code?  JScript example would be very helpful.

     E

    Filed under:
  • 02-21-2012 08:40 AM In reply to

    Re: execute a resource file form code?

    Hi ek38,

     It seems you already asked this in a separate thread.  Any reason you started up a new one? It looks like your Process.Start() approach was probably the most appropriate way to go, but perhaps the process wasn't starting up in the right path.  Have you tried explicitly specifying the full path?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-27-2012 06:57 AM In reply to

    • ek38
    • Top 200 Contributor
    • Joined on 02-14-2006
    • Posts 54

    Re: execute a resource file form code?

    Jimmy,

     Anson provided me with an example of how to do it.  The answer involved "Code".  I do not know execute a resource file in code so I added a thread to the "code" forum seeking an example in JScript.

     Can you elaborate on the commands in JScript to do this? 

     

    Filed under:
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.