Jump to content

Deleting the registry key of the running script


Recommended Posts

Hi all,

I'm running a script on a Server 2003 Standard Edition machine and would like to clean up after running the script. I've run regshot and found that I'm creating a key that's listing my script every time I run it. If I try to delete the key inside the script, it won't work because the script is still running. I find that the key is still there after my script is finished running. How can I address this from within the confines of my script?

Suggestions anyone?

thanks!

max :lmao:

Link to comment
Share on other sites

Hi all,

  I'm running a script on a Server 2003 Standard Edition machine and would like to clean up after running the script.  I've run regshot and found that I'm creating a key that's listing my script every time I run it.  If I try to delete the key inside the script, it won't work because the script is still running.  I find that the key is still there after my script is finished running.  How can I address this from within the confines of my script?

Suggestions anyone?

thanks!

max :lmao:

<{POST_SNAPBACK}>

can you post a small example that's try to reproduce your concern. I am not sure to understand what the key is , who create it the script? or ...
Link to comment
Share on other sites

can you post a small example that's try to reproduce your concern. I am not sure to understand what the key is , who create it the script? or ...

<{POST_SNAPBACK}>

Okay, I ran regshot and found that I'm creating a new entry in

HKU\S-1-5-21-3419523026-1351854349-3420083848-500\Software\Microsoft\Windows\ShellNoRoam\MUICache", "A:\MyTest_rev1.02.03.exe")

So, prior to my exiting the script I run a RegDelete command to kill that entry.

Thing is, after the script ends I go into regedit and find that it's still there. Another entry must be getting written to the registry immediately after I delete this one. Not sure how to handle this with automation.

I'm running a compiled executable from a floppy "A:". I noticed that if I use a USB card "E:" that nothing gets written to the registry.

hmmmm....

max

Link to comment
Share on other sites

hi

just run a registry cleaner or something, 90% of programs u use will be added to the MUI cache unless u disable it

also your key is user specific, if u are wanting 2 port that 2 another machine where the user is named different it wont work

Link to comment
Share on other sites

See if this helps. IF it creates the entry in the same spot all the time (does it???) you can create a .reg file to delete the registry. All you do is package this .reg file with your script and copy it to say c:\temp or seld destructing batch file or smthng like that. Then use the AT command to schedule anew task. The task will be to run the reg file. Your script will set it to run at the end of the script after say 2 minutes..Your script should be done then...and the task will run and delete the registry entry.

These may help:

Writing a .Reg file

http://msdn.microsoft.com/library/default....gistry_File.asp

Using AT command:

http://support.microsoft.com/default.aspx?...b;en-us;Q313565

Good Luck

Link to comment
Share on other sites

hi

just run a registry cleaner or something, 90% of programs u use will be added to the MUI cache unless u disable it

also your key is user specific, if u are wanting 2 port that 2 another machine where the user is named different it wont work

<{POST_SNAPBACK}>

Right on. Thanks for helping me out.

max

Link to comment
Share on other sites

hi

just run a registry cleaner or something, 90% of programs u use will be added to the MUI cache unless u disable it

also your key is user specific, if u are wanting 2 port that 2 another machine where the user is named different it wont work

<{POST_SNAPBACK}>

a self-destructing batch file? How does one go about creating a self-destructing batch file?

max

Link to comment
Share on other sites

See if this helps. IF it creates the entry in the same spot all the time (does it???) you can create  a .reg file to delete the registry. All you do is package this .reg file with your script and copy it to say c:\temp or seld destructing batch file or smthng like that. Then use the AT command to schedule anew task. The task will be to run the reg file. Your script will set it to run at the end of the script after say 2 minutes..Your script should be done then...and the task will run and delete the registry entry.

These may help:

Writing a .Reg file

http://msdn.microsoft.com/library/default....gistry_File.asp

Using AT command:

http://support.microsoft.com/default.aspx?...b;en-us;Q313565

Good Luck

<{POST_SNAPBACK}>

A self-destructing batch file?

How?

max

Link to comment
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
 Share

  • Recently Browsing   0 members

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