Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ExecApp and .bat
#1
Hi,

I am trying to use ExecApp to launch a .bat file, but it is reporting that it is not a valid win32 application.

Can this action only launch .com or .exe?

thanks.
Reply
#2
Try saving it as a .cmd?
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#3
Batch files are never actually run directly. The command line makes it look like it is, but what it really does is run cmd.exe for you and pass the batch file to it.

So you want to run:

cmd.exe /c X:\path\whatever.bat

The /c will make it close the command window when its done. If you want it to stay open, use /k instead.
Dean Roddey
Explorans limites defectum
Reply
#4
I amended my ExecApp to this:

cmd.exe /c d:\program files\cqc\graph.bat

and it still comes up with not a valid application.
I ran the command at the command prompt and it says that the device is not ready.

Thanks.
Reply
#5
Cmd.exe may not be in the path. Use C:\\Windows\\System32\\cmd.exe

Don't forget to use double slashes if you use a path in an action command, otherwise if one of the characters after the slash is an escape character, you won't get the result you expect.
Dean Roddey
Explorans limites defectum
Reply
#6
c:\\windows\\system\\cmd.exe /c d:\program files\cqc\graph.bat

gives:
The filename , directory, or volume label syntax is incorrect.

Thanks.
Reply
#7
You need to escape the D:\\Program Files\\ part as well probably.
Dean Roddey
Explorans limites defectum
Reply
#8
Dean, how do you run a bat file using execapp. The instruction you gave in this post do not work.
Reply
#9
This is what I tried

System::ExecApp
P1=c:\\windows\\system32\\cmd.exe
P2=cmd.exe /k C:\Batch Files\Winamp.bat
P3=c:\\windows\\system32
P4=Show

I get C:\Batch is not recognized as an internal or external command operable program or batch file
Reply
#10
eded9698 Wrote:This is what I tried

System::ExecApp
P1=c:\\windows\\system32\\cmd.exe
P2=cmd.exe /k C:\Batch Files\Winamp.bat
P3=c:\\windows\\system32
P4=Show

I get C:\Batch is not recognized as an internal or external command operable program or batch file

The space between Batch and Files won't work.

I think you need to quote it like "Batch Files" or rename the directory to remove the space.
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  ExecApp to Start/Stop Windows Service? jaydonoghue 6 3,055 01-04-2017, 06:46 PM
Last Post: Dean Roddey
  Getting errors from ExecApp? dlmorgan999 5 1,932 07-21-2015, 10:29 AM
Last Post: Dean Roddey
  ExecApp for CML? bbrendon 22 5,352 07-15-2014, 10:37 AM
Last Post: Dean Roddey
  ExecApp Trioxide 11 2,242 03-13-2013, 02:03 PM
Last Post: Trioxide
  ExecApp loading multiple copies of same app? jkish 3 1,249 08-05-2008, 07:01 PM
Last Post: Dean Roddey
  ExecApp and StartRemApp Parameters jrlewis 6 1,847 11-03-2007, 05:11 PM
Last Post: jrlewis
  System ExecApp with IV jpants 4 1,465 10-23-2007, 06:48 AM
Last Post: jpants

Forum Jump:


Users browsing this thread: 1 Guest(s)