daslick Posted March 27, 2007 Share Posted March 27, 2007 Run('cmd.exe /c start "C:\windows\notepad.exe""', @HOMEDRIVE, @SW_HIDE) what is the problem here? It runs the command prompt, not notepad. Yes, I have to do it through cmd... but whats wrong w/ my quotes? Link to comment Share on other sites More sharing options...
Developers Jos Posted March 27, 2007 Developers Share Posted March 27, 2007 Run('cmd.exe /c start "C:\windows\notepad.exe"', @HOMEDRIVE, @SW_HIDE) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
daslick Posted March 27, 2007 Author Share Posted March 27, 2007 Nevermind.... I moved one of your quotes and now it works.... THANKS. Run('cmd.exe /c "start C:\windows\notepad.exe"', @HOMEDRIVE, @SW_HIDE) Link to comment Share on other sites More sharing options...
Helge Posted March 27, 2007 Share Posted March 27, 2007 I'm curious...why do people seem to find it needed to launch CMD.exe and make that launch another EXE-file for them, when they can just start the file that they actually want to start directly with Run anyway ? Like...this for example : Run("C:\windows\notepad.exe") Link to comment Share on other sites More sharing options...
EndFunc Posted March 27, 2007 Share Posted March 27, 2007 (edited) I'm curious...why do people seem to find it needed to launch CMD.exe and make that launch another EXE-file for them, when they can just start the file that they actually want to start directly with Run anyway ? Like...this for example : Run("C:\windows\notepad.exe")oÝ÷ Ûú®¢×Ê"¶Ç¯zw²'«Â+ajëh×6Run("notepad.exe") because it in the windows system dir. Edited March 27, 2007 by EndFunc EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
daslick Posted March 27, 2007 Author Share Posted March 27, 2007 uhg I didn't want to get into that. I won't tell you right away why I'm using cmd, because I'm going to show you some of my code, and from that you should see why I am using cmd.exe. My new problem is with @AutoItExe & " /AutoIt3ExecuteLine " & "Run('cmd.exe /c "start C:\windows\notepad.exe"', @HOMEDRIVE, @SW_HIDE)") This gives me an error every time.... and I've tried many different ways. The "C:\windows\notepad.exe" is the default line in the GUI to show the end user an example of how to type in the locations to files. C:\windows\notepad.exe will be where the user's command will be inserted. Please help Thanks Link to comment Share on other sites More sharing options...
Richard Robertson Posted March 27, 2007 Share Posted March 27, 2007 Why would you execute a line like that? That seems very pointless when you can run the function directly. You still haven't shown us why you are using cmd either. Link to comment Share on other sites More sharing options...
daslick Posted March 27, 2007 Author Share Posted March 27, 2007 uhm.... @AutoItExe & " /AutoIt3ExecuteLine " & "Run('cmd.exe /c "start C:\windows\notepad.exe"', @HOMEDRIVE, @SW_HIDE)") I am using that line because I am making a remote access program.... the client just sends autoit commands to the server... since you cannot call normal functions, like run, I am using autoit3executeline... when u are using that you cannot AutoItSetOption("RunErrorsFatal", 0) , so if the client told the server to run a file that did not exist, it would come up with an autoit error. This is why I didn't want to get into WHY i am using this tedious method... but there you have it. So, can you fix it or not? Link to comment Share on other sites More sharing options...
Helge Posted March 28, 2007 Share Posted March 28, 2007 (edited) Also its even easier with...Sure, but that wasn't my point. The point was the logic and not how short the code is. Edit : Beat 'cha ! Run('notepad') Edited March 28, 2007 by Helge Link to comment Share on other sites More sharing options...
daslick Posted March 28, 2007 Author Share Posted March 28, 2007 (edited) wonderful.... now there is a personal competition on my forum that isn't even addressing the issue of syntax. great. @AutoItExe & " /AutoIt3ExecuteLine " & "Run('cmd.exe /c "start C:\windows\notepad.exe"', @HOMEDRIVE, @SW_HIDE)") Edited March 28, 2007 by daslick Link to comment Share on other sites More sharing options...
theguy0000 Posted March 28, 2007 Share Posted March 28, 2007 (edited) wonderful.... now there is a personal competition on my forum that isn't even addressing the issue of syntax. great. @AutoItExe & " /AutoIt3ExecuteLine " & "Run('cmd.exe /c "start C:\windows\notepad.exe"', @HOMEDRIVE, @SW_HIDE)")oh, calm down. @AutoItExe & ' /AutoIt3ExecuteLine "Run('&"'cmd.exe /c "&'"start C:\windows\notepad.exe"'&"', @HOMEDRIVE, @SW_HIDE))" edit: no wait, that won't work... Edited March 28, 2007 by theguy0000 The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
daslick Posted March 28, 2007 Author Share Posted March 28, 2007 ooo a good post... thanks, I'm testing it right now... which requires that I change both the client and server.... I'll post back when I get the results . THANKS Link to comment Share on other sites More sharing options...
theguy0000 Posted March 28, 2007 Share Posted March 28, 2007 (edited) i think this one works... @AutoItExe & ' /AutoIt3ExecuteLine "Run('&"'cmd.exe /c "&'''''start C:\windows\notepad.exe'''''&"', @HOMEDRIVE, @SW_HIDE)"&'"' Edited March 28, 2007 by theguy0000 The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
daslick Posted March 28, 2007 Author Share Posted March 28, 2007 Okay... last thing. in your code you put @AutoItExe & ' /AutoIt3ExecuteLine "Run('&"'cmd.exe /c "&'"start C:\windows\notepad.exe"'&"', @HOMEDRIVE, @SW_HIDE))" Mine actually is divided up like this Run(@AutoItExe & " /AutoIt3ExecuteLine " & $Cmd)If you look at yours, it does not have the closed single quote until the end... mine doesn't use those at all... Thanks so much! Link to comment Share on other sites More sharing options...
Helge Posted March 28, 2007 Share Posted March 28, 2007 wonderful.... now there is a personal competition on my forum that isn't even addressing the issue of syntax. great.I can only guess that you're referring to my post there... Anyway, there's no competition going on here, and my edit wasn't avictory-attempt at all. You clearly didn't understand that so just move along, calm down and keep that smile wide. Link to comment Share on other sites More sharing options...
EndFunc Posted March 28, 2007 Share Posted March 28, 2007 Sure, but that wasn't my point. The point was the logic and not how short the code is. Edit : Beat 'cha ! Run('notepad') Barely EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
daslick Posted March 28, 2007 Author Share Posted March 28, 2007 I'm actually smiling right now... ... its just kind of a let-down when u wait and wait and finally see a post! - then see that its just people running notepads... Can anyone seperate one of the posted working run commands into this format? :\ Run(@AutoItExe & " /AutoIt3ExecuteLine " & $Cmd) where $Cmd is the run command Thanks Link to comment Share on other sites More sharing options...
daslick Posted March 28, 2007 Author Share Posted March 28, 2007 Okay... I have tried run(@AutoItExe & ' /AutoIt3ExecuteLine "Run('&"'cmd.exe /c "&'''''start C:\windows\notepad.exe'''''&"', @HOMEDRIVE, @SW_HIDE)"&'"')and it does not work. Also, I need a way to send commands to a variable and run them like this...Run(@AutoItExe & " /AutoIt3ExecuteLine " & $Cmd)currently, I have gotten none of the suggested code to work. Could someone please take a look? Link to comment Share on other sites More sharing options...
Developers Jos Posted March 28, 2007 Developers Share Posted March 28, 2007 currently, I have gotten none of the suggested code to work. Could someone please take a look?Something like this? run(@AutoItExe & ' /AutoIt3ExecuteLine "Run(@COMSPEC & '' /c start "C:\windows\notepad.exe"'')', @HOMEDRIVE, @SW_HIDE) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
daslick Posted March 28, 2007 Author Share Posted March 28, 2007 Yes, thanks. Thats the first line that has worked. I still, because of the position of the second single-quote, don't see how to user a variable for the command. Run(@AutoItExe & ' /AutoIt3ExecuteLine "$Cmd)Now there are problems with quotes again. At least now we KNOW that it can be done. Thanks JdeB! 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