moinuddin_sh Posted December 18, 2006 Share Posted December 18, 2006 I run a batch file to update the Antivirus DAT file on each computer on my Domain 2003 network, whenever a user login to a computer. Now I want to replace this bat with script file. What should I add in my script to run DAT file whenever a user login.Regards Link to comment Share on other sites More sharing options...
cluberti Posted December 18, 2006 Share Posted December 18, 2006 I'm confused - you want to replace a .bat or .cmd file with a .vbs script, is that correct? Link to comment Share on other sites More sharing options...
moinuddin_sh Posted December 19, 2006 Author Share Posted December 19, 2006 I have a batch file created by me to update the new antivirus DAT files that I want to replace with one addition line in my following login script.' VBScript.' Mapping user home folder on the serverDim oNet, sUser, sDeptSet oNet = CreateObject("Wscript.Network")sUser =oNet.UserNamesDept =oNet.DeptoNet.MapNetworkDrive "P:", "\\Server01\" & sUser 'Mapping Network Attached Drives'Dim WshNetwork'Set WshNetwork = WScript.CreateObject("WScript.Network")'WshNetwork.MapNetworkDrive "M:", "\\Server01\CMT"'WshNetwork.MapNetworkDrive "Q:", "\\Server01\Public Folder"'WshNetwork.MapNetworkDrive "S:", "\\Server01\Share"'WshNetwork.MapNetworkDrive "W:", "\\Server01\Course"'WshNetwork.MapNetworkDrive "Z:", "\\Server01\CopyScan"'Mapping Network Attached PrintersDim netSet net = CreateObject("WScript.Network") net.AddWindowsPrinterConnection Lpt1: \\Server01\HPLaserJetAccount'Selecting default printerSet net = CreateObject("WScript.Network") net.SetDefaultPrinter "\\Server01\HPLaserJetAccount" Link to comment Share on other sites More sharing options...
cluberti Posted December 20, 2006 Share Posted December 20, 2006 Moving to more appropriate forum. Link to comment Share on other sites More sharing options...
LLXX Posted December 20, 2006 Share Posted December 20, 2006 If there's nothing that the batch file can't do, then I suggest you continue to use a batch file instead of a script. Link to comment Share on other sites More sharing options...
moinuddin_sh Posted December 21, 2006 Author Share Posted December 21, 2006 I found the VB script that can autoupdate the antivirus through login script.Thanks to everyone. Link to comment Share on other sites More sharing options...
moinuddin_sh Posted December 23, 2006 Author Share Posted December 23, 2006 Here is the VB script that I added in my existing login script file. There is only one issue is there how can I run the update in Slient mode. When I add /Silent switch the did not work.Dim oShellSet oShell = WScript.CreateObject ("WSCript.shell")oShell.run "\\Server01\Mcafee\sdatnew.exe"Set oShell = NothingIf I use the silent switch as mentioned below then the script does not work.Dim oShellSet oShell = WScript.CreateObject ("WSCript.shell")oShell.run "\\Server01\Mcafee\sdatnew.exe /Silent"Set oShell = Nothing Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now