These all have to do with login scripts. I can do it with login scripts, i just need to do it on a subnet of computers. I need to push this install at a specific time.
Main Topics
Browse All TopicsI need to remove and add network printers from multiple computers. In the past i have used a simple script like this:
On Error Resume Next
Set objNetwork = CreateObject("WScript.Netw
objNetwork.AddWindowsPrint
objNetwork.AddWindowsPrint
This worked fine for a login script. But now i need to run this against a set of multiple comptuers on our network. I would like to run it by subnet if possible.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Greetings DJohnson104, Sorry for the delay.
Check following script. You need to add computer names inside the file (you can use IP Scanner to get particular subnet computer names).
Read the instructions and run the script from command prompt.
Hope this helps.
:: ================
:: READ THIS FIRST
:: ================
:: * You need to have Administrative rights to run this script
:: * This script require "Computers.txt" file from where it will pick computer names.
:: * This script requires "PSExec.exe" (comes with PSTools) to execute bat file on remote system.
:: - Download it from Microsoft site
:: http://www.microsoft.com/t
:: * You need to set AdimUsername, AdminPassword and NetworkPrinter variables inside the script
:: - Like:
:: SET AdimUsername=FKazi <- username having Administrative rights
:: SET AdminPassword=MyPassword <- user password
:: SET NetworkPrinter=\\SERVER\PR
:: * Copy and Paste following script into notepad and save it with any name having .cmd extension.
:: All three files (ScriptFile.cmd, Computers.txt, and PSExec.exe) should on the same path
:: SCRIPT START
@ECHO OFF
SETLOCAL EnableDelayedExpansion
SET AdimUsername=Administrator
SET AdminPassword=MyPassword
SET NetworkPrinter=\\SERVER\PR
ECHO On Error Resume Next >MapPrn.vbs
ECHO Set objNetwork = CreateObject^("WScript.Net
ECHO objNetwork.AddWindowsPrint
IF NOT EXIST Computers.txt Goto ShowErr
FOR %%R IN (Computers.txt) Do IF %%~zR EQU 0 Goto ShowErr
FOR /F %%c IN ('Type Computers.txt') Do (
IF /I NOT "%%c"=="!COMPUTERNAME!" (
Echo Processing: %%c
PING -n 1 -w 1000 %%c|Find /I "TTL" >NUL
IF NOT ErrorLevel 1 (
Copy /Y MapPrn.vbs \\%%c\C$ >NUL
PSExec -i -u !AdimUsername! -p !AdminPassword! \\%%c WScript.exe C:\MapPrn.vbs
DEL /F /Q \\%%c\C$\MapPrn.vbs
)ELSE (Echo %%c: Not able to connect)
)ELSE (ECHO Skipping: %%c)
)
Goto EndScript
:ShowErr
Echo "Computers.txt" file does not exist or file is empty!
:EndScript
IF EXIST MapPrn.vbs DEL /F /Q MapPrn.vbs
ENDLOCAL
EXIT /B 0
:: SCRIPT END
Business Accounts
Answer for Membership
by: farhankaziPosted on 2007-09-24 at 11:17:09ID: 19950378
Have you gone through following:
e.com/OS/ M icrosoft_O perating_S ystems/Ser ver/Q_2247 5777.html
e.com/Netw orking/Mic rosoft_Net work/ Q_220 72201.html
e.com/OS/ M icrosoft_O perating_S ystems/Ser ver/Q_2274 6765.html
echnet/scr iptcenter/ resources/ qanda/jul0 6/hey0719. mspx
http://www.experts-exchang
http://www.experts-exchang
http://www.experts-exchang
http://www.microsoft.com/t
Hope this helps!