Tsiyoshi Posted March 30, 2009 Posted March 30, 2009 Hello, I'm trying to run this script for printer mapping but the only way I succedded to do it is with sleep function. The problem is that when I close the printer window (the function) the script is still being executed and does not terminate. Need help replacing the sleep with another function maybe. Thanks in advance! $objSysInfo = ObjCreate("ADSystemInfo") $SiteName = $objSysInfo.SiteName $SiteName = StringReplace($SiteName,"-","/") If StringRight($SiteName, 1) <> "/" Then $SiteName = $SiteName & "/" $objSysInfo="" $oWSHell = ObjCreate("Shell.application") $oWSHell.FindPrinter ("",$SiteName,"") Sleep (100000000) $oWSHell = ""
Bert Posted March 30, 2009 Posted March 30, 2009 You are waiting on the print spooler service to restart. Look here:http://www.autoitscript.com/forum/index.ph...&hl=spooler The Vollatran project My blog: http://www.vollysinterestingshit.com/
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