Endpoint Protection

 View Only

Remotely Run Symantec Antivirus Related Batch file 

Mar 22, 2012 09:28 PM

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

Statistics
0 Favorited
4 Views
1 Files
0 Shares
0 Downloads
Attachment(s)
zip file
Scripts.zip   189 KB   1 version
Uploaded - Feb 25, 2020

Tags and Keywords

Comments

Oct 16, 2012 10:38 PM

Nice script for remotely access.

Sep 19, 2012 07:10 PM

thank

Aug 25, 2012 12:51 PM

hey thanks for your useful information

Aug 17, 2012 08:45 AM

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

Jun 28, 2012 08:23 AM

nice

Apr 06, 2012 11:30 PM

hi,

Can we using this script run any batch file.

Apr 03, 2012 11:22 PM

hi,

thanks for sharing

Mar 28, 2012 11:22 PM

good helpfull for running script.

Mar 28, 2012 01:39 AM

nice script

Mar 27, 2012 10:16 PM

yes good for see remotaly run batch file.

 

I will be bookmark this script and using in my Organization.

Mar 27, 2012 10:10 PM

Thanks ashish for you reply

I will Check and if found any problem found get back you.

 

yes

Mar 27, 2012 10:02 PM

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

 

Mar 27, 2012 09:39 PM

Hi Ashish,

Thanks for providing script.

can you tell me which type we have using this script.

 

Thanks....

Related Entries and Links

No Related Resource entered.