Jump to content

RunWait(@ComSpec ...) Problem in Win98


Recommended Posts

I want to use the following command in a script:

RunWait( @ComSpec & " /C """ & $commandline & """", "", @SW_HIDE )

where

$commandline = FileGetShortName(@ScriptDir) &"\MIDIcut.exe -from "& $Beginning & " -till "& $End & " "& $shortpath &" "& FileGetShortName(@ScriptDir) &"\Output\"& $shortfile

This works just fine in Windows XP, but when trying in Windows 98, I get the error Error: Unable to execute the external command with beneith that A device connected to the system doesn't work.

I also tried to replece @ComSpec with "Command.com", which won't work either. What am I doing wrong?

Link to comment
Share on other sites

Thanks for trying to help. I just tried it, but it won't work either :ph34r:

what's the error? Did you know you can just hit control-c on the error screen (win2k&xp) and get the text of the error?

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

sending it with the quotes around everything as we both were doing it, would probably confuse windows.

if you type this in CMD

C:\> "somefile.exe something else"
it wouldn't work...

but if you type this way

C:\> somefile.exe "something else"
it would...

so maybe what you need is simply:

RunWait( @ComSpec & ' /c ' & $commandline , "", @SW_HIDE )
which doesn't have double quotes surronding everything.

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

now try...

$commandline = FileGetShortName(@ScriptDir) & "\MIDIcut.exe -from " & _
   $Beginning & " -till " & $End & " " & $shortpath & " " & _
   FileGetShortName(@ScriptDir) & "\Output\" & $shortfile

MsgBox(4096,"",$commandline)

RunWait( @ComSpec & ' /c ' & $commandline, '', @SW_HIDE )

<{POST_SNAPBACK}>

It stil works in Windows XP this way, but I keep getting the error message in Windows 98...
Link to comment
Share on other sites

I believe the $commandline string may be too many characters for Command.com. try using the working directory parameter...

$commandline = "MIDIcut.exe -from " & _
  $Beginning & " -till " & $End & " " & $shortpath & " .\Output\" & $shortfile

MsgBox(4096,"",$commandline)

RunWait( @ComSpec & ' /c ' & $commandline, @ScriptDir, @SW_HIDE )

There may be something not considered here, but the idea is to shorten the command line.

LAr.

<{POST_SNAPBACK}>

It works now, loads of thanks to all of you who helped :ph34r:

"MIDIcut.exe -from "& $Beginning & " -till "& $End & " "& $shortpath &" " &".\Output\"& $shortfile
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...