JustScriptIt
Technical User
I have a script that
1. Asks for password to stop service. Hides the inputted password.
2. Stops service
3. Deletes file
4. Starts service
But, it uses
1. VBScript (for step 1)
2. Batch file (for steps 2 to 4)
How do I incorporate the batch code into the VBScript. I'd like to execute this silently on remote computers across our network.
VBScript
Batch file that uses GetPwd.vbs
1. Asks for password to stop service. Hides the inputted password.
2. Stops service
3. Deletes file
4. Starts service
But, it uses
1. VBScript (for step 1)
2. Batch file (for steps 2 to 4)
How do I incorporate the batch code into the VBScript. I'd like to execute this silently on remote computers across our network.
VBScript
Code:
' GetPwd.vbs - Get password with no echo then echo it. '
Option Explicit
Dim oScriptPW, strPassword
Set oScriptPW = CreateObject("ScriptPW.Password")
strPassword = oScriptPW.GetPassword()
Wscript.StdOut.WriteLine strPassword
Batch file that uses GetPwd.vbs
Code:
@echo off
:: GetPwd.cmd - Get password with no echo.
<nul: set /p passwd=Enter Password to stop Symantec service:
for /f "delims=" %%i in ('cscript /nologo GetPwd.vbs') do set passwd=%%i
echo.
"%programfiles%\symantec\symantec endpoint protection\smc.exe" -stop passwd
del "%programfiles%\Symantec Endpoint Protection\LiveUpdate\luinfo.dat
"%programfiles%\symantec\symantec endpoint protection\smc.exe" -start