maxcronjob Posted February 10, 2005 Share Posted February 10, 2005 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 Link to comment Share on other sites More sharing options...
jpm Posted February 10, 2005 Share Posted February 10, 2005 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 <{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 More sharing options...
maxcronjob Posted February 11, 2005 Author Share Posted February 11, 2005 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 More sharing options...
MCT Posted February 11, 2005 Share Posted February 11, 2005 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 More sharing options...
ennis Posted February 11, 2005 Share Posted February 11, 2005 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 filehttp://msdn.microsoft.com/library/default....gistry_File.aspUsing AT command:http://support.microsoft.com/default.aspx?...b;en-us;Q313565Good Luck Link to comment Share on other sites More sharing options...
maxcronjob Posted February 11, 2005 Author Share Posted February 11, 2005 hijust run a registry cleaner or something, 90% of programs u use will be added to the MUI cache unless u disable italso 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 More sharing options...
maxcronjob Posted February 11, 2005 Author Share Posted February 11, 2005 hijust run a registry cleaner or something, 90% of programs u use will be added to the MUI cache unless u disable italso 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 More sharing options...
maxcronjob Posted February 11, 2005 Author Share Posted February 11, 2005 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 filehttp://msdn.microsoft.com/library/default....gistry_File.aspUsing AT command:http://support.microsoft.com/default.aspx?...b;en-us;Q313565Good Luck<{POST_SNAPBACK}>A self-destructing batch file?How?max Link to comment Share on other sites More sharing options...
CyberSlug Posted February 11, 2005 Share Posted February 11, 2005 (edited) REM this is MyBatchFile.bat REM do stuff here... del MyBatchFile.bat Edited February 11, 2005 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now