Guillaume Posted July 30, 2004 Share Posted July 30, 2004 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\"& $shortfileThis 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 More sharing options...
ezzetabi Posted July 30, 2004 Share Posted July 30, 2004 It seems more a midicut problem that an Autoit one. Link to comment Share on other sites More sharing options...
Guillaume Posted July 30, 2004 Author Share Posted July 30, 2004 (edited) I think that's not true, while I get the following window:I never get to see a MidiCut console window (not even with @SW_HIDE removed). Edited July 30, 2004 by Guillaume Link to comment Share on other sites More sharing options...
emmanuel Posted July 30, 2004 Share Posted July 30, 2004 May I suggest this way? RunWait( @ComSpec & ' /C "' & $commandline & '"', "", @SW_HIDE ) "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
Guillaume Posted July 30, 2004 Author Share Posted July 30, 2004 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 Link to comment Share on other sites More sharing options...
emmanuel Posted July 30, 2004 Share Posted July 30, 2004 Thanks for trying to help. I just tried it, but it won't work either 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 More sharing options...
emmanuel Posted July 30, 2004 Share Posted July 30, 2004 sending it with the quotes around everything as we both were doing it, would probably confuse windows. if you type this in CMDC:\> "somefile.exe something else" it wouldn't work... but if you type this wayC:\> 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 More sharing options...
Guillaume Posted July 30, 2004 Author Share Posted July 30, 2004 Well, I already played around with the quotes, but didn't succeed. When trying the line you posted I still got the error... Link to comment Share on other sites More sharing options...
Guillaume Posted July 31, 2004 Author Share Posted July 31, 2004 (edited) start with a 1 line script... Run(@comspec) do you get a dos window? Lar. <{POST_SNAPBACK}>That works flawlessly... Edited July 31, 2004 by Guillaume Link to comment Share on other sites More sharing options...
Guillaume Posted August 1, 2004 Author Share Posted August 1, 2004 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 More sharing options...
SlimShady Posted August 1, 2004 Share Posted August 1, 2004 I think this error message. I think that's not true, while I get the following window: I never get to see a MidiCut console window (not even with @SW_HIDE removed). <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
Guillaume Posted August 1, 2004 Author Share Posted August 1, 2004 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: Link to comment Share on other sites More sharing options...
Guillaume Posted August 3, 2004 Author Share Posted August 3, 2004 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 "MIDIcut.exe -from "& $Beginning & " -till "& $End & " "& $shortpath &" " &".\Output\"& $shortfile Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now