Remotely Run Symantec Antivirus Related Batch file
Hi,
This vbscript will be helpful for run remotely any batch file.
You can be enter system host name in computer.txt and run vbs file.
I have tested my organization and successfully remove the Symantec antivirus hardware id and replace the syslink file.
Note: kindly copy PsExec.exe freeware tool download for http://technet.microsoft.com/en-us/sysinternals/bb897553 and for copy c:\windows\system32\ after run the vbscript.
**************************************************Script *****************************************************************
Option Explicit
Const ForReading = 1
Const ForWriting = 2
Const OverwriteExisting = TRUE
Dim objFSO, strComputer, objFile, filesys, testfile, strPSExec, strCmd, objShell, strUser, strPass
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Scripts\Computer.txt") 'Change the name and location of the output file as needed
Set filesys = CreateObject("Scripting.FileSystemObject")
Set testfile = filesys.CreateTextFile("c:\scripts\ScriptFeedback.txt", True) 'Change the name and location of the output file as needed
strUser = InputBox("Please Enter Your Username: " & (Chr(13) & Chr(10)) & "(Format:domain\username) ")
strPass = InputBox("Please Enter Your password: ")
Do Until objFile.AtEndOfStream
On Error Resume Next
strComputer = objFile.ReadLine
Set objShell = CreateObject("Wscript.Shell")
strPSExec = "c:\windows\system32\psexec.exe"
strCmd = strPSExec & " -d " & " -u " & strUser & " -p " & strPass & " \\" & strComputer & " cmd /c " & "\\systemname\c$\Scripts\Delete.bat" 'Change to reflect location of batch file in network
objShell.Run strCmd, 0, False
If Err.Number <> 0 Then
testfile.WriteLine strComputer
Err.Clear
End If
Set objFSO = Nothing
Loop
testfile.Close
Comments 13 Comments • Jump to latest comment
Hi Ashish,
Thanks for providing script.
can you tell me which type we have using this script.
Thanks....
You can be run this script on your system and you will be Remotely Run any batch file and complete large amount you work.
Prerequisite run this script.
1) Copy c:\windows\system32\ PsExec.exe freeware tool (Available http://technet.microsoft.com/en-us/sysinternals/bb897553).
2) Give the host name in Computer.txt.
3) Give the batch file path here:- ("\\systemname\c$\Scripts\Delete.bat" )
4) Run the batch file.
5) Give the domain username and password.
after you have check your script are successfully run .
Thanks in advance.
Ashish Sharma
Thanks In Advance
Ashish Sharma
SEPM Knowledgebase Documents
Thanks ashish for you reply
I will Check and if found any problem found get back you.
I will be bookmark this script and using in my Organization.
Thanks....
Don't forget to mark your thread as 'SOLVED' with the answer that best helped you
nice script
good helpfull for running script.
hi,
thanks for sharing
hi,
Can we using this script run any batch file.
nice
Very nice script Ashish I have attached a bat file that I use to execute if possible could you please change the above script to do the commands in the bat script
hey thanks for your useful information
thank
Nice script for remotely access.
Would you like to reply?
Login or Register to post your comment.