Jump to content

Recommended Posts

Posted

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?

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
Posted

May I suggest this way?

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

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

Posted

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:
Posted

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)

Posted

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)

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
Posted

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...
Posted

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}>

Posted

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

Posted

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

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
  • Recently Browsing   0 members

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