Sign in to follow this  
Followers 0
daslick

syntax .... very simple?

28 posts in this topic

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?

Share this post


Link to post
Share on other sites



Nevermind.... I moved one of your quotes and now it works.... THANKS.

Run('cmd.exe /c "start C:\windows\notepad.exe"', @HOMEDRIVE, @SW_HIDE)

Share this post


Link to post
Share on other sites

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")

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by EndFunc

EndFuncAutoIt is the shiznit. I love it.

Share this post


Link to post
Share on other sites

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

Thanks

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

#9 ·  Posted (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 by Helge

Share this post


Link to post
Share on other sites

#10 ·  Posted (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 by daslick

Share this post


Link to post
Share on other sites

#11 ·  Posted (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. :whistle:

@AutoItExe & ' /AutoIt3ExecuteLine "Run('&"'cmd.exe /c "&'"start C:\windows\notepad.exe"'&"', @HOMEDRIVE, @SW_HIDE))"

edit: no wait, that won't work...

Edited by theguy0000

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

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 :whistle:. THANKS

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

i think this one works...

@AutoItExe & ' /AutoIt3ExecuteLine "Run('&"'cmd.exe /c "&'''''start C:\windows\notepad.exe'''''&"', @HOMEDRIVE, @SW_HIDE)"&'"'
Edited by theguy0000

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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 a

victory-attempt at all. You clearly didn't understand that so just move along, calm down and keep that smile wide.

Share this post


Link to post
Share on other sites

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

EndFuncAutoIt is the shiznit. I love it.

Share this post


Link to post
Share on other sites

I'm actually smiling right now... :whistle:... 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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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)

:whistle:


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Yes, thanks. :whistle: 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. :P Thanks JdeB!

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