llarava
asked on
Help with a VBS printer check and program execution
Hi,
Can someone help us out with the following scenario:
-Our printers to are configured via GPO/Preferences
-Some users have an application that needs the printer to mapped in order to work launch correctly. There is a little delay for the GPO to finish mapping the printer and the program sometimes starts before the default printer is mapped.
I was wondering how hard would be to have a script that will call the app .exe as soon as the printer is available to the computer via group policy.
Can someone help us out with the following scenario:
-Our printers to are configured via GPO/Preferences
-Some users have an application that needs the printer to mapped in order to work launch correctly. There is a little delay for the GPO to finish mapping the printer and the program sometimes starts before the default printer is mapped.
I was wondering how hard would be to have a script that will call the app .exe as soon as the printer is available to the computer via group policy.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi, the script is retrying every second, up to intTimeout seconds. Within the loop, it queries the printer objects, and if a default network one is found, it exits the loop, otherwise it waits one second, and checks again.
It should work the way you want it to, but if not, I'll do more testing.
Rob,
It should work the way you want it to, but if not, I'll do more testing.
Rob,
ASKER
Excellent! Thank you!
ASKER
Thank you very much! Would it be possible for the script to loop one time in case during the 30 seconds the printer has not been mapped? For example the script runs after 30 seconds then it runs again and tries to find the printer if it's not then will do nothing. I understand we could extend the time to 60, however if the printer is ready sooner then we should be able to get the app launched much quicker.
Thanks!