Jump to content

Recommended Posts

Posted

I am needing to build a script that does a RunAs and goes and deletes a specific registry key.

I found the following script...

If $CmdLine[0] = 0 then

RunAsSet("Administrator", @Computername, "adminpassword")

Run('"' & @SCRIPTFULLPATH & '" parameter' )

Exit

EndIf

My question is, will this mask the login of the admin? In other words, when my user runs this... will they be able to see the password being typed?

My next question is, how do I delete a specific registry key?

Thanks in advance.

Posted

I am needing to build a script that does a RunAs and goes and deletes a specific registry key.

I found the following script...

If $CmdLine[0] = 0 then

RunAsSet("Administrator", @Computername, "adminpassword")

Run('"' & @SCRIPTFULLPATH & '" parameter' )

Exit

EndIf

My question is, will this mask the login of the admin? In other words, when my user runs this... will they be able to see the password being typed?

My next question is, how do I delete a specific registry key?

Thanks in advance.

try it and see if its starts out the password if it does than your fine and it will work for ever one

Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes

Posted

Function Reference

RegDelete

--------------------------------------------------------------------------------

Deletes a key or value from the registry.

RegDelete ( "keyname" [, "valuename"] )

ex. RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE", "TestKey")

would dlete the registry key "Testkey" loacated in "HKEY_LOCAL_MACHINE\SOFTWARE"

tolle indicium

Posted

Thank you for all the prompt replies...

I appreciate it.

First off, I didnt realize the help files were so in depth... so Ill be reading those more often from here on out.

The key I need to delete is...

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing

I dont know what its for but I do know that it prevents my users from using remote desktop after a certain period of time. So I need to write a script that I can send them, and run it as an admin on their machine.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...