Here is what I'm trying to accomplish.
I am incorporating this into my login.bat file which maps user network drives and checks SAV status. When the users mapped drives are missing, they simply run the batch file and it remaps their drives. Now since I add/remove, rename, etc printers often, I need a batch file to remove the current network printers and then add the new network printers. Now with what I have, it works great as long as the user have the printers listed below, but if they don't, the user will be promted with 14 error messages and they need to press ok each time. This error message appears from the first section on the batch file with the switch /gd which deletes a printer, /ga adds a printer. Now I need to add an IF statement meaning, if this network printer is present, dont delete it. IF this network printer is not present, skip it and go to the next printer to delete. When the batch file completes the first delete section, stops and restarts the local print spooler it then goes to the add printers section.
So this batch file needs to run with no user interaction wether or not the printer is there or not since this will be tied in together with the map drives batch files.
So where would I add the IF statements or IF EXISTS statements?
Here is what I have so far which works perfect on computers that have all their printers, even if they have no connection to the server. But it dont work perfect on computers that have no printers installed, an example would be a new user. All he would have to do is run the batch file and he is done. This would cut down on the number of calls I get if I can get this to work perfect.
rundll32 printui.dll,PrintUIEntry /gd /n \\hebfps001\HEBHP4000-001_Assembly_Rack"
rundll32 printui.dll,PrintUIEntry /gd /n \\hebfps001\HEBHP4000-002_Receiving"
rundll32 printui.dll,PrintUIEntry /gd /n \\hebfps001\HEBHP4000-003_Materials"
rundll32 printui.dll,PrintUIEntry /gd /n \\hebfps001\HEBHP4050-001_QA_Lab"
rundll32 printui.dll,PrintUIEntry /gd /n \\hebfps001\HEBHP4050-004_Assembly"
rundll32 printui.dll,PrintUIEntry /gd /n \\hebfps001\HEBHP4600-001_Office_Color"
rundll32 printui.dll,PrintUIEntry /gd /n \\hebfps001\HEBHP8100-001_Pick_List"
rundll32 printui.dll,PrintUIEntry /gd /n \\hebfps001\HEBHP8100-002_UPS_Line"
rundll32 printui.dll,PrintUIEntry /gd /n \\hebfps001\HEBHP8150-001"
net stop spooler
net start spooler
rundll32 printui.dll,PrintUIEntry /ga /n \\hebfps001\HEBHP4000-001_Assembly_Rack"
rundll32 printui.dll,PrintUIEntry /ga /n \\hebfps001\HEBHP4000-002_Receiving"
rundll32 printui.dll,PrintUIEntry /ga /n \\hebfps001\HEBHP4000-003_Materials"
rundll32 printui.dll,PrintUIEntry /ga /n \\hebfps001\HEBHP4050-001_QA_Lab"
rundll32 printui.dll,PrintUIEntry /ga /n \\hebfps001\HEBHP4050-004_Assembly"
rundll32 printui.dll,PrintUIEntry /ga /n \\hebfps001\HEBHP4600-001_Office_Color"
rundll32 printui.dll,PrintUIEntry /ga /n \\hebfps001\HEBHP8100-001_Pick_List"
rundll32 printui.dll,PrintUIEntry /ga /n \\hebfps001\HEBHP8100-002_UPS_Line"
rundll32 printui.dll,PrintUIEntry /ga /n \\hebfps001\HEBHP8150-001"
net stop spooler
net start spooler
I am incorporating this into my login.bat file which maps user network drives and checks SAV status. When the users mapped drives are missing, they simply run the batch file and it remaps their drives. Now since I add/remove, rename, etc printers often, I need a batch file to remove the current network printers and then add the new network printers. Now with what I have, it works great as long as the user have the printers listed below, but if they don't, the user will be promted with 14 error messages and they need to press ok each time. This error message appears from the first section on the batch file with the switch /gd which deletes a printer, /ga adds a printer. Now I need to add an IF statement meaning, if this network printer is present, dont delete it. IF this network printer is not present, skip it and go to the next printer to delete. When the batch file completes the first delete section, stops and restarts the local print spooler it then goes to the add printers section.
So this batch file needs to run with no user interaction wether or not the printer is there or not since this will be tied in together with the map drives batch files.
So where would I add the IF statements or IF EXISTS statements?
Here is what I have so far which works perfect on computers that have all their printers, even if they have no connection to the server. But it dont work perfect on computers that have no printers installed, an example would be a new user. All he would have to do is run the batch file and he is done. This would cut down on the number of calls I get if I can get this to work perfect.
rundll32 printui.dll,PrintUIEntry /gd /n \\hebfps001\HEBHP4000-001_Assembly_Rack"
rundll32 printui.dll,PrintUIEntry /gd /n \\hebfps001\HEBHP4000-002_Receiving"
rundll32 printui.dll,PrintUIEntry /gd /n \\hebfps001\HEBHP4000-003_Materials"
rundll32 printui.dll,PrintUIEntry /gd /n \\hebfps001\HEBHP4050-001_QA_Lab"
rundll32 printui.dll,PrintUIEntry /gd /n \\hebfps001\HEBHP4050-004_Assembly"
rundll32 printui.dll,PrintUIEntry /gd /n \\hebfps001\HEBHP4600-001_Office_Color"
rundll32 printui.dll,PrintUIEntry /gd /n \\hebfps001\HEBHP8100-001_Pick_List"
rundll32 printui.dll,PrintUIEntry /gd /n \\hebfps001\HEBHP8100-002_UPS_Line"
rundll32 printui.dll,PrintUIEntry /gd /n \\hebfps001\HEBHP8150-001"
net stop spooler
net start spooler
rundll32 printui.dll,PrintUIEntry /ga /n \\hebfps001\HEBHP4000-001_Assembly_Rack"
rundll32 printui.dll,PrintUIEntry /ga /n \\hebfps001\HEBHP4000-002_Receiving"
rundll32 printui.dll,PrintUIEntry /ga /n \\hebfps001\HEBHP4000-003_Materials"
rundll32 printui.dll,PrintUIEntry /ga /n \\hebfps001\HEBHP4050-001_QA_Lab"
rundll32 printui.dll,PrintUIEntry /ga /n \\hebfps001\HEBHP4050-004_Assembly"
rundll32 printui.dll,PrintUIEntry /ga /n \\hebfps001\HEBHP4600-001_Office_Color"
rundll32 printui.dll,PrintUIEntry /ga /n \\hebfps001\HEBHP8100-001_Pick_List"
rundll32 printui.dll,PrintUIEntry /ga /n \\hebfps001\HEBHP8100-002_UPS_Line"
rundll32 printui.dll,PrintUIEntry /ga /n \\hebfps001\HEBHP8150-001"
net stop spooler
net start spooler