JBeardNC Posted June 15, 2009 Share Posted June 15, 2009 I am writing a script to uninstall VMWare Player and delete the VM files off of a computer and I can uninstall VMWare Player just fine but I can't delete the C:\VM folder where the virtual machine files are located. The C:\VM folder is 16.6GB, one file in particular is 15GB, and I believe that is the reason that I'm having trouble. The Windows Recycle Bin can't handle files that large. Although, it should be bypassing the Recycle Bin because I'm not using the FileRecycle() function. I've tried using both the FileDelete() and DirRemove() functions, but neither of them work. Here's the code I'm using. Has anybody heard of this before or had similar issues? $UninstallString = "MsiExec.exe /qn /X{A53A11EA-0095-493F-86FA-A15E8A86A405} REBOOT=REALLYSUPPRESS /log C:\FTG\Logs\VMWarePlayerUninstall.log" $VMFolder = "C:\VM" RunWait ( $UninstallString ) DirRemove ( $VMFolder ) Link to comment Share on other sites More sharing options...
GEOSoft Posted June 15, 2009 Share Posted June 15, 2009 I suspect your problem will be the REBOOT=REALLYSUPPRESS. There may be a file in use that can't be deleted until after the reboot. It's not a difficult work-around if that turns out to be the cause. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
erik7426 Posted June 15, 2009 Share Posted June 15, 2009 (edited) Have you tried... DirRemove($VMFolder,1) If the recurse flag is left out or set to 0 the DirRemove function will only remove empty directories. Edited June 15, 2009 by erik7426 Link to comment Share on other sites More sharing options...
JBeardNC Posted June 15, 2009 Author Share Posted June 15, 2009 Have you tried... DirRemove($VMFolder,1) If the recurse flag is left out or set to 0 the DirRemove function will only remove empty directories. Erik - You da man. That worked. Thanks! Link to comment Share on other sites More sharing options...
Inverted Posted June 16, 2009 Share Posted June 16, 2009 I guess it was really hard to read the DirRemove function's help file entry. Better to create a thread on the forums Link to comment Share on other sites More sharing options...
JBeardNC Posted June 16, 2009 Author Share Posted June 16, 2009 I guess it was really hard to read the DirRemove function's help file entry. Better to create a thread on the forums I'd just like to apologize. I'm SO sorry for wasting Inverted's precious time asking a question. It probably took him more time to write a reply than it did to read through the post. I'm just glad that he set me straight. I'll be sure to read through the help file 15 times before making a post again. How dare I post a question on a "General Help and Support" forum. I should be waterboarded for that.Actually, I had already tried DirRemove ( $VMFolder, 1 ) before I wrote the original post because I did and always do check the help file first. What ended up fixing it was, instead of using the variable in the DirRemove function, I wrote out the path and did DirRemove ( "C:\VM", 1 ) and that seemed to work. Not sure why it didnt work with the variable in there. I didn't mention that in my follow up post because other than letting everyone know that this was resolved, I didn't think it was really wasnt worth mentioning. Thanks everyone for your help. And again, I'm very sorry, Inverted. I hope, for your co-workers sake, that you are in a better mood by lunch time. It must suck working with a jerk all day. Link to comment Share on other sites More sharing options...
Inverted Posted June 16, 2009 Share Posted June 16, 2009 I was just being a little sarcastic, read my post again, no need calling me a jerk. Seems you're the one in a bad mood. 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