danelliott87 Posted October 15, 2015 Posted October 15, 2015 Hi everyone, hope someone can shed some light on an issue iv'e been having. I have created a script to uninstall a product called Ranger Guardian (Basically Securus) and the script works perfectly if I double click and run it. However, the script will not run/does not seem to work when I place it in group policy as a startup/shutdown script? The script is: wmic product where name="Ranger Guardian Client v5.00" call uninstall /nointeractive What am i missing?
themightymrp Posted October 15, 2015 Posted October 15, 2015 Is this a batch file? If so are you using .cmd or .bat as the extension? For some unknown reason, my scripts for startup/shutdown only work when I use .bat
danelliott87 Posted October 15, 2015 Author Posted October 15, 2015 Thanks for the reply. It is a .bat file yes
themightymrp Posted October 15, 2015 Posted October 15, 2015 Try adding in some parenthesis like this: wmic product where (name="Ranger Guardian Client v5.00") call uninstall /nointeractive
themightymrp Posted October 15, 2015 Posted October 15, 2015 Does the script need to be run with administrator privileges or under a particular login? I've never used it but isn't there some kind of "RangerRemove" login used for doing the uninstall?
LeMarchand Posted October 15, 2015 Posted October 15, 2015 Does the script need to be run with administrator privileges or under a particular login? I've never used it but isn't there some kind of "RangerRemove" login used for doing the uninstall? You're right there - when I finally got rid of Ranger I had to use that on the few machines that weren't re-imaged.
danelliott87 Posted October 15, 2015 Author Posted October 15, 2015 You're right there - when I finally got rid of Ranger I had to use that on the few machines that weren't re-imaged. It was my understanding scripts that run in startup or shutdown use elevated permissions anyway? This isn't Ranger for networks i should add, it's just a re-badged Securus (safeguarding software).
LeMarchand Posted October 15, 2015 Posted October 15, 2015 It was my understanding scripts that run in startup or shutdown use elevated permissions anyway? This isn't Ranger for networks i should add, it's just a re-badged Securus (safeguarding software). My bad. I only had to deal with R4N. Maybe the uninstall needs something running? Try it as a scheduled task a short while after logon?
themightymrp Posted October 15, 2015 Posted October 15, 2015 Could you look in the registry of one machine under HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall and try to find a key related to the software? It may show an uninstall string you could use in the script instead i.e. msiexec /x {8u8s-u29s-usu2-19sa-46235542532523} or some-such
danelliott87 Posted October 16, 2015 Author Posted October 16, 2015 Could you look in the registry of one machine under HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall and try to find a key related to the software? It may show an uninstall string you could use in the script instead i.e. msiexec /x {8u8s-u29s-usu2-19sa-46235542532523} or some-such I did actually try this but the program was prompting to confirm uninstall. Wasn't sure if i could automate this response with a switch? Or modify the script somehow? This is the script i used for the above: if exist "c:\program files\RangerGuardian\securusn.exe" (MsiExec.exe /X{8484FCFD-39DC-4A55-B3AF-6792B5A6EB32})
themightymrp Posted October 16, 2015 Posted October 16, 2015 Try adding /q or /qn to the end of the command i.e. if exist "c:\program files\RangerGuardian\securusn.exe" (MsiExec.exe /X{8484FCFD-39DC-4A55-B3AF-6792B5A6EB32} /q)
danelliott87 Posted October 16, 2015 Author Posted October 16, 2015 Thanks for the idea. I have tried the script and it does remove the prompt. Sadly though i won't be able to use the script as it doesn't completely remove the program. Still leaves most of it behind in the program files folder. Still cant work out why my other script wont run from startup or shutdown. Am i missing something? 1. Create GPO and navigate to computer config>policies>Windows settings>scripts (startup/shutdown) 2. Select either option and click Show files 3. Paste script into this folder 4. Click Add and select pasted script 5. Assign GPO to appropriate workstations
themightymrp Posted October 16, 2015 Posted October 16, 2015 That procedure looks right. Can you view the event logs of one of the machines and see why the script isn't running? It might provide a clue i.e. permissions. The script you put in the opening post works fine and removes everything if you run it manually right?
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