![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Read zip files? Remove targeted file? New to PowerShell and need to know if there is the capability to read through zip files targeting a specific file extension and removing the target from each archive? -- <%= Clinton Gallagher NET csgallagher AT metromilwaukee.com URL http://clintongallagher.metromilwaukee.com/ |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Read zip files? Remove targeted file? "clintonG" <nobody@nowhere.com> wrote in message news:u1h2A4TfHHA.4636@TK2MSFTNGP03.phx.gbl... > New to PowerShell and need to know if there is the capability to read > through zip files targeting a specific file extension and removing the > target from each archive? With built-in functions using essentially the Windows zip folders support I can't seem to do better than do what you want but getting a file comfimation dialog box for each file to delete: $shellApp = new-object -com shell.application $zipFile = $shellApp.NameSpace("full_path_to_zip_file") $zipFile.Items() | Where { $_.Name -like "*.txt" } | foreach { $_.InvokeVerb("Delete") } |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Read zip files? Remove targeted file? "Adam" <newsadam@gmail.com> wrote in message news:OvXe5SffHHA.3928@TK2MSFTNGP03.phx.gbl... > > "clintonG" <nobody@nowhere.com> wrote in message > news:u1h2A4TfHHA.4636@TK2MSFTNGP03.phx.gbl... >> New to PowerShell and need to know if there is the capability to read >> through zip files targeting a specific file extension and removing the >> target from each archive? > > With built-in functions using essentially the Windows zip folders support > I can't seem to do better than do what you want but getting a file > comfimation dialog box for each file to delete: > > $shellApp = new-object -com shell.application > $zipFile = $shellApp.NameSpace("full_path_to_zip_file") > $zipFile.Items() | Where { $_.Name -like "*.txt" } | foreach { > $_.InvokeVerb("Delete") } Hey Adam thanks for responding and choosing to fool around with this one. If specific file types can be found within zipped archives and deleted that's good news. Crippleware like AutoCAD litters file systems with .bak files and network admins will end up zipping many gigabytes of unwanted .bak files because Autodesk software is GFS and can't be controlled using policies in this context. Can you confirm a method to delete the files within the zipped archive which will also dismiss the dialog or circumvent the dialog altogether? Keeping my fingers crossed on this one. The point is it will be costly to put a CAD monkey at the keyboard just to dismiss dialog boxes so it would be right back to square one for this task. <%= Clinton |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| How to read .bak file or .dbk files | General Discussion | |||
| Remove Read Only on a file in System folder | Vista security | |||
| Unable to remove read-only attribute from files and folders | Vista file management | |||
| How to remove read-only property of a file? | PowerShell | |||
| How to open a file for read/write access in Program Files directory | Vista security | |||