nice_guy75 Posted May 4, 2010 Posted May 4, 2010 (edited) Hi guys,I have written a simple script for deleting files of startup folder and install folder of windows folder in Autoit. But when I run this script (au3 file) in my installed OS it is working fine but when I compile this au3 file to exe and try to use in my installation kit the FileDelete command is not deleting all the files of Install Folder. It is promptly deleting shortcut which I placed in Startup folder and also deleting some of the files of install folder but not all the files. Please go through this script and suggest a solution. I suppose it actually start deleting file and then before all the file could be deleted it start reading next command so all the files are not deleted.For your information the actuall size of my install folder is around 48MB.Here is my script:FileDelete("C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup")FileDelete("C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup")FileDelete("C:\Windows\Install")RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{98D99750-0B8A-4c59-9151-589053683D73}")Sleep (20000)Shutdown(3)Exit Edited May 4, 2010 by nice_guy75
MrJinje Posted May 4, 2010 Posted May 4, 2010 (edited) Are you saying it is not working from your DVD while installing, or it is not working at all, even when you manually running it on a machine where you are 100% sure the files are not in use or locked.Usually files cannot be deleted because they are in use, I would look at what process is holding those files open. http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx Edited May 4, 2010 by MrJinje
Yzöwl Posted May 4, 2010 Posted May 4, 2010 Are you sure that attributes will not create a problem for you?Not only is ProgramData a hidden directory but both the Startup directories contain at least one file, desktop.ini, which is a System and Hidden file.
MrJinje Posted May 4, 2010 Posted May 4, 2010 I am sure it is not attributes as he was able to delete the short-cuts. His problem seems to be in his install folder and my guess it will turn out to be a rogue asynchronous install that needs to finish before deletion can occur.He might just need to add another sleep (20000) to the beginning of the script to allow this 'rogue' install to finish. Failing that, we might have to look at how he is installing his applications. It is possible to call a batch script from a "synchronous" first logon command, and have that batch file accidentally start an asynchronous command (by not using the start /WAIT parameter). If that is the case, it might be a simple fix.
nice_guy75 Posted May 4, 2010 Author Posted May 4, 2010 Yeah, my shortcuts are getting deleted, I am getting problem with install folder, and that too not entirely. Some of the files are deleted but not all. I don't know why?????????And yes when I run those scripts in au3 files in my installed OS all my files are getting deleted but when I compile those au3 files in exe and put in my installation kit, all my files in the install folder are not getting deleted.Please help me guys. Though I have now dropped that idea of install folder and Autoit, instead I have now captured the install.wim after installing those applications which I was putting in install folder, but still just for the learing purpose I wish to know the reason and solution of this problem. Please try to understand I am not a programmer so try to explain considering me a newbie as far as Autoit commands and DOS commands are concerned I hope the moderators would not close this thread.
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