Sign in to follow this  
Followers 0
Nova

Wrighting "quotes" to a console

6 posts in this topic

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



#2 ·  Posted (edited)

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

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

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

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

#5 ·  Posted (edited)

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

#6 ·  Posted (edited)

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

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

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