Sign in to follow this  
Followers 0
Guillaume

RunWait(@ComSpec ...) Problem in Win98

13 posts in this topic

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?

Share this post


Link to post
Share on other sites



It seems more a midicut problem that an Autoit one.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I think that's not true, while I get the following window:

Posted Image

I never get to see a MidiCut console window (not even with @SW_HIDE removed).

Edited by Guillaume

Share this post


Link to post
Share on other sites

May I suggest this way?

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

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

Share this post


Link to post
Share on other sites

May I suggest this way?

RunWait( @ComSpec & ' /C "' & $commandline & '"', "", @SW_HIDE )
Thanks for trying to help. I just tried it, but it won't work either :ph34r:

Share this post


Link to post
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)

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

Well, I already played around with the quotes, but didn't succeed. When trying the line you posted I still got the error...

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

start with a 1 line script...

Run(@comspec)

do you get a dos window?

Lar.

<{POST_SNAPBACK}>

That works flawlessly... Edited by Guillaume

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites

I think this error message.

I think that's not true, while I get the following window:

Posted Image

I never get to see a MidiCut console window (not even with @SW_HIDE removed).

<{POST_SNAPBACK}>

Share this post


Link to post
Share on other sites

No No, I inserted a MsgBox to show the value of $commandline before the run statement. I would like to know what the value of $commandline is.

Lar.

<{POST_SNAPBACK}>

Oh of course, well that works like a charm:

Posted Image

Share this post


Link to post
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

Share this post


Link to post
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
Sign in to follow this  
Followers 0