It is very hard to read a script with no formatting. See if you can fix it so we can read it.
You also need to ask a question.
Technology Tips and News
It is very hard to read a script with no formatting. See if you can fix it so we can read it.
You also need to ask a question.
Ok so here it is, I need to create a shortcut in which I can be prompted if I would like to shut down windows (Action to shutdown when clicking ok). Any ideas?
So far the working shutdown shortcut that I have does not issue the prompt a message asking if I truly want to shutdown or cancel the shortcut request.
Helpful suggestions are very much needed, as I mentioned I am new to scripting.
It does not work, won't help what I already know ;)
Here it is:
Dim shellApp, answerYour code can never run. It has too many syntax errors. Fix the errors first.\
Why is there an "End Function" in the middle of the code.
If you earned too format code properly you would see where your errors are very quickly.
Why create a shortcut if you can execute the shutdown command directly? This simplified script will shut down Windows after 120 seconds, to give you a chance to cancel the command while testing.
Set oShell = CreateObject("WScript.Shell")
If MsgBox("Do you really want to shut down the computer?", 1,"Turn off Computer Script!") = 1 _
Then oShell.Run "shutdown.exe /s /f /t 120", 1, True
Frederik,
I wish it were that easy but I attempt to follow guidance to the T when possible. I know a script is capable of a great many things but what I cannot figure out is how to initiate the shutdown with a pop-up message asking me to confirm the shutdown. I feel like I am really close to the result but cannot fathom where I am going wrong.
I wish it were that easy but I attempt to follow guidance to the T when possible. I know a script is capable of a great many things but what I cannot figure out is how to initiate the shutdown with a pop-up message asking me to confirm the shutdown.