reggiep Posted April 18, 2011 Posted April 18, 2011 I have just moved our print control software, Papercut, from one server to another . My problem has come after what I thought would be the hard bit. I have a locally installed program that runs at start up which connects to the old server to give users their printing balance. My new install runs straight from a share so that is no problem. Can anyone suggest how i can disable this program from running across all my clients? Thanks
sted Posted April 18, 2011 Posted April 18, 2011 if exist "c:\Documents and Settings\All Users\Start Menu\Programs\Startup\my shortcut.lnk" del "c:\Documents and Settings\All Users\Start Menu\Programs\Startup\my shortcut.lnk" /q startup script for a week or so should do it (if its vista /7 just add a 2nd line with appropriate file location) 1
reggiep Posted April 19, 2011 Author Posted April 19, 2011 Thanks Sted, Unfortunately it isn't in the startup folder I can see it when I run msconfig. I can disable it there but I don't want to have to run round every machine!!
Hightower Posted April 19, 2011 Posted April 19, 2011 Can you not do this using Group Policy Preferences on S2008? 1
Steve21 Posted April 19, 2011 Posted April 19, 2011 Try this: const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "." Set objReg=GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") KeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\DONTKNOWWATTHISISCALLED" Return = objReg.DeleteKey(HKEY_LOCAL_MACHINE, KeyPath) If (Return = 0) And (Err.Number = 0) Then Wscript.Echo "Key Delete Complete!!!" Else Wscript.Echo "Key Delete Failed!!! Error = " & Err.Number End If Obviously can remove the echo's, and "YOU NEED" to change the path to whatever it's called Don't know what papercut is regged under. Might want to check it before deploying, but think it's right. Steve 1
reggiep Posted April 21, 2011 Author Posted April 21, 2011 (edited) @Steve21 I grabbed your vb script and edited it so it now looks like this... const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "." Set objReg=GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") KeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\PaperCut NG Client" Return = objReg.DeleteKey(HKEY_LOCAL_MACHINE, KeyPath) If (Return = 0) And (Err.Number = 0) Then Wscript.Echo "Key Delete Complete!!!" Else Wscript.Echo "Key Delete Failed!!! Error = " & Err.Number End If However I get an error = 0 Do I need to put the papercut bit in extra quotes? Screenshot Edited April 21, 2011 by reggiep
Steve21 Posted April 21, 2011 Posted April 21, 2011 One sec, realised I was dumb when I wrote a line of that. Lemme fix it. Steve
Steve21 Posted April 21, 2011 Posted April 21, 2011 const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "." Set objReg=GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") KeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" Return = objReg.DeleteValue(HKEY_LOCAL_MACHINE, KeyPath, "PaperCut NG Client") If (Return = 0) And (Err.Number = 0) Then Wscript.Echo "Key Delete Complete!!!" Else Wscript.Echo "Key Delete Failed!!! Error = " & Err.Number End If Try that, Was trying to delete the key rather than a value (Also check that name PaperCut NG Client is right, as when you posted it it added lots of random spaces) Shout if that works, Steve 1
reggiep Posted April 21, 2011 Author Posted April 21, 2011 Thanks Steve, You are a wonder. That worked perfectly.
Steve21 Posted April 21, 2011 Posted April 21, 2011 Thanks Steve, You are a wonder. That worked perfectly. Cool, no problems. Yeah I was being stupid, deleteKey deletes the "folder" aka if it was a PaperCut folder next to the Run folder Needed Value for the "string" as such. Any other problems, just gimme a shout or PM Steve
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