Jump to content
Sign in to follow this  
Nova

Wrighting "quotes" to a console

Recommended Posts

Nova

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?

Share this post


Link to post
Share on other sites
buzz44

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

Share this post


Link to post
Share on other sites
MSLx Fanboy

Shutdown -a aborts, but I think I'm too late... :)


Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

Share this post


Link to post
Share on other sites
Nova

Now I cant use $var !

Using ur example thsi dosent work !

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

Share this post


Link to post
Share on other sites
w0uter

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

Share this post


Link to post
Share on other sites
buzz44

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

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  

×