Jump to content

Deleting large files (size)


Recommended Posts

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

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

I guess it was really hard to read the DirRemove function's help file entry. Better to create a thread on the forums :D

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

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...