JustScriptIt
Technical User
I have a script that will shut down a service based on the password a user supplied.
However, I prefer to use system variable, because user may have Program Files in a different drive.
This is what I have so far
And I get the error
(17, 22) Microsoft VBScript compilation error: Invalid character
Thank you for your help!
However, I prefer to use system variable, because user may have Program Files in a different drive.
This is what I have so far
Code:
Option Explicit
Dim objPassword, strPassword, objShell, objWMIService, intProcessID, intReturn
Set objPassword = CreateObject("ScriptPW.Password")
WScript.StdOut.Write "Please enter your password:"
strPassword = objPassword.GetPassword()
Set objShell = WScript.CreateObject("WScript.Shell")
Set objWMIService = GetObject("winmgmts:\\" & "." & "\root\cimv2:Win32_Process")
objWMIService.Create(%programfiles% & " \Symantec Endpoint Protection\smc.exe -stop " & strPassword)
And I get the error
(17, 22) Microsoft VBScript compilation error: Invalid character
Thank you for your help!