just_david Posted February 21, 2017 Posted February 21, 2017 Simple as it says really. Is this safe to do? Someone built a deployment on a site we look after and some muppett left half a gig of files in the default users download folder. Que filled hard drives with 6gb of service accounts. Can I just delete the files from the .wim, as all they are is a handful of unused .exe files?
snagrat Posted February 21, 2017 Posted February 21, 2017 Yes, as long as the files are not required by the OS Mount, delete, commit and unmount.
just_david Posted February 21, 2017 Author Posted February 21, 2017 Yes, as long as the files are not required by the OS Mount, delete, commit and unmount. Given what these are, exe's for paint.net etcm could i be as lazy as to open the archive with 7zip and delete them?
snagrat Posted February 21, 2017 Posted February 21, 2017 Never used 7Zip to do it personally so insure
3s-gtech Posted February 21, 2017 Posted February 21, 2017 I don't think you can - while you may be able to browse the contents, you'll struggle to modify it then make it still work afterwards.
Arthur Posted February 21, 2017 Posted February 21, 2017 Is this safe to do? Never tried 7-Zip, but it's easy enough to do using a PowerShell script and at least you would know your image would still work afterwards. #Requires -Version 5.0 #Requires -RunAsAdministrator #Requires -Modules Dism # Get script directory if ($myInvocation.MyCommand.CommandType -ne [system.Management.Automation.CommandTypes]::Script) { $ScriptDir = [system.IO.Path]::GetDirectoryName($myInvocation.MyCommand.Definition) } else { $ScriptDir = [system.IO.Path]::GetDirectoryName($psISE.CurrentFile.FullPath) } Set-Location "$ScriptDir" $Image = "$ScriptDir\install.wim" $MountFolder = "$ScriptDir\Mount" if (!(Test-Path -path $MountFolder)) { New-Item -Path $MountFolder -ItemType Directory -Force | Out-Null } Mount-WindowsImage -ImagePath $Image -Index 1 -Path $MountFolder Remove-Item "$ScriptDir\Mount\Users\Default\Downloads\*" -Recurse -Force Dismount-WindowsImage -Path $MountFolder -Save Note. Place .ps1 script into the same folder as the install.wim and then run. Make a copy of the image just in case though. 1
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