Author Topic: How to run a file?  (Read 1189 times)

Aslamma

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
How to run a file?
« on: May 07, 2010, 09:40:32 am »
I want to run a .bat file, but not sure how this is done.  If it can't be done with a device, can it be done via script?

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: How to run a file?
« Reply #1 on: May 08, 2010, 03:41:19 pm »
You can use the Desktop driver to run a batch file.
John Hughes
Codecore Technologies

Aslamma

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: How to run a file?
« Reply #2 on: May 08, 2010, 05:24:42 pm »
Well, I thought of that, but don't know how to implement it.  It does not seem straightforward (to me at least).

What I did was add a "desktop application" device with c:\windows\system32\cmd.exe.  I was then hoping to use the "start application" drop down, but all it gives in the script is .StartApplication(), which is not helpful to me. 

Am I on the right track or barking up the wrong tree?

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: How to run a file?
« Reply #3 on: May 09, 2010, 11:20:16 am »
Yes the StartApplication method is what runs your script.
John Hughes
Codecore Technologies

Aslamma

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: How to run a file?
« Reply #4 on: May 09, 2010, 03:37:50 pm »
I don't get it.  Is there a link or example of what the script should look like?  All that comes up is ".StartApplication", which by itself means nothing.  I don't see anywhere in the documentation about how this works.

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: How to run a file?
« Reply #5 on: May 09, 2010, 08:30:24 pm »
You would add a new desktop device and specify the batch file as the file path setting... lets assume you named the device mybat.

So to run the batch files the script would look like:

mybat.StartApplication();

Are you not seeing the name of the device?
John Hughes
Codecore Technologies

Aslamma

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: How to run a file?
« Reply #6 on: May 09, 2010, 09:03:18 pm »
Ok, got it now.  My problem was that the scripting identifier was blank and since I didn't know what I was looking for I couldn't identify it easily.  Thanks for the help.

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: How to run a file?
« Reply #7 on: May 09, 2010, 09:12:20 pm »
A blank scripting identifier should not be possible... but I do see the issue and will hive it fixed in the next version.
John Hughes
Codecore Technologies