Link to home
Start Free TrialLog in
Avatar of shairankhan
shairankhan

asked on

how to create a batch file that adds the registry values and deletes itself?

Hi, i am system admin for a small distributed network. i want to put the netcat in the windows but as my network is distributed it would take time , what i have thought to put the netcat in systems and remove the shared drives. so can you please tell me how can i add a batch file to system start up folder that it adds the netcat registry value to registry automatically without interaction and deletes it self with out adding registry key every time and bothering the users when the system reboots?is there any alternative solution to this please, if batch file is not a good idea?
ASKER CERTIFIED SOLUTION
Avatar of herbus
herbus
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Keep in mind that the example I posted had %userprofile% variable paths, which would apply to a user login script, not a computer startup script... I'd copied it from one I use at work and forgot to change that bit... if it's a computer startup script you'd replace it with "c:\temp\regadd.log" or whatever...

...and of course you'll want to test it before deploying it network-wide via a policy or such...

Cheers,
Herb
Avatar of David Johnson, CD
Rather than coding in hard values you can use system variables %temp% instead of c:\documents and settings\%userprofile% ..
G'day LeeTutor & folks,.. the recommendations for cleanup are normally spot on, but in this case I'm confident that the solution I posted is valid.  If there's no objection I'd put my hand up to claim this as answered...

Cheers,
Herb