Sign in to follow this  
Followers 0
erbailey

RunAS (Hidden)

7 posts in this topic

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.

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

Read the help file for registry deltetion please.


tolle indicium

Share this post


Link to post
Share on other sites

This all depends what registry key you want to delete ...

You have to remember you load a different HKCU hive .......


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0