Jump to content

How can I stop a locally installed program running at start across whole network?


Recommended Posts

Posted

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

Posted

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)

  • Thanks 1
Posted

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!!

Posted

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 :p Don't know what papercut is regged under.

 

Might want to check it before deploying, but think it's right.

 

Steve

  • Thanks 1
Posted (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 by reggiep
Posted

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 :p (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

  • Thanks 1
Posted
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 :p

 

Needed Value for the "string" as such.

 

Any other problems, just gimme a shout or PM

 

Steve

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...