title: vbscript that creates a shortcut to desktop and when user clicks on it prompts them for shut down
body: <p>I am currently working on a script that will create a shortcut to the desktop and when clicked on, will prompt a user if they want to shut down. When I test my script, it just decides to run automatically. Is there a way I can maybe seperate the two functions (creating shortcut and prompting user for shutdown?). </p>
  
  <p>Here is my code:</p>
  
  <pre><code>dim shellApp , answer
  Set shellApp = CreateObject("Shell.Application")
  Set wshObject = WScript.CreateObject("WScript.Shell")
  desktopFolder = wshObject.SpecialFolders("Desktop")
  Set myShortcut = wshObject.CreateShortcut(desktopFolder &amp; "\\Shut Down.lnk" )
  myShortcut.TargetPath ="C:\Users\Grant\Scripts\ChristianGrantProblem1.vbs"
  myShortcut.Save()
  answer = MsgBox("The Turn off Computer dialog will be opened, if you wish to shut down, continue.", 1 )
  If answer = 1 then ' User clicked on OK
  Initiate_Logoff()
  End If
  </code></pre>