Jump to content

Wrighting "quotes" to a console


Nova
 Share

Recommended Posts

How can one send quotes to a console window using autoit?

Im trying to send shutdown -s -f -t 9999 -c "Shutting down"

but I can only manage to send shutdown -s -f -t 9999 -c Shutting down

For a console : Words seperated by a space must be inclosed in quotes !

This works (comment is only one word long!)

$wait = 9999
$comment = "Shutting"

RunWait(@ComSpec & " /c " & 'shutdown -s -f -t ' & $wait & " -c " & $comment, "", @SW_HIDE)

This dose not work (comment is more than one word long!)

$wait = 9999
$comment = "Shutting down"

RunWait(@ComSpec & " /c " & 'shutdown -s -f -t ' & $wait & " -c " & $comment, "", @SW_HIDE)

Sugestions anyone?

Link to comment
Share on other sites

RunWait(@ComSpec & ' /c  shutdown -s -f -t 9999 -c "Shutting down"', "", @SW_HIDE)

Lol, I just 'tested' it and now my comp is going to shutdown in 2hrs 45 mins lol. It works.

Edited by Burrup

qq

Link to comment
Share on other sites

Now I cant use $var !

Using ur example thsi dosent work !

RunWait(@ComSpec & ' /c  shutdown -s -f -t " & $wait & " -c " & $comment', "", @SW_HIDE)

<{POST_SNAPBACK}>

you need to get the qotes right.

by head i think it sould be this:

RunWait(@ComSpec & ' /c shutdown -s -f -t ' & $wait & ' -c "' & $comment & '"', "", @SW_HIDE)
Edited by w0uter

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

Link to comment
Share on other sites

I tested the above because my comp is already gonna turn off lol. I think its right... i didnt get any errors, but nothing happened because I already have the window going so it should work.

Edit: YES! "Shutdown -a" does abort it =).

Edited by Burrup

qq

Link to comment
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
 Share

  • Recently Browsing   0 members

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