![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | How do I compress a folder using the File System Object? I'm experimenting with setting folder attributes using the FSO. I've been able to set the other attributes but not compression. Shouldn't it be as easy as: Dim objFolder, objFSO Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder("C:\Scripts") objFolder.Attributes = 2048 I don't get any errors, just nothing happens. I can hide the folder and turn on the archive flag using this method. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: How do I compress a folder using the File System Object? On Dec 1, 3:19*pm, Matthias Tacke <Matth...@xxxxxx> wrote: Quote: > Larry wrote: Quote: > > I'm experimenting with setting folder attributes using the FSO. I've been > > able to set the other attributes but not compression. Shouldn't it be as easy > > as: Quote: > > Dim objFolder, objFSO > > Set objFSO = CreateObject("Scripting.FileSystemObject") > > Set objFolder = objFSO.GetFolder("C:\Scripts") > > objFolder.Attributes = 2048 Quote: > > I don't get any errors, just nothing happens. I can hide the folder andturn > > on the archive flag using this method. > This vb program (easily found with google) might inspire you ;-)http://www.visualbasic.happycodings....es_Drives/code... it. It's a real time saver. strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root \CIMV2") Set objShare = objWMIService.Get("Win32_Directory.Name='c:\'") Set objOutParams = objWMIService.ExecMethod("Win32_Directory.Name='c: \dell'", "Compress") |
My System Specs![]() |
| | #3 (permalink) |
| | Re: How do I compress a folder using the File System Object? Thanks. "BigDaddyJim" wrote: Quote: > On Dec 1, 3:19 pm, Matthias Tacke <Matth...@xxxxxx> wrote: Quote: > > Larry wrote: Quote: > > > I'm experimenting with setting folder attributes using the FSO. I've been > > > able to set the other attributes but not compression. Shouldn't it be as easy > > > as: Quote: > > > Dim objFolder, objFSO > > > Set objFSO = CreateObject("Scripting.FileSystemObject") > > > Set objFolder = objFSO.GetFolder("C:\Scripts") > > > objFolder.Attributes = 2048 Quote: > > > I don't get any errors, just nothing happens. I can hide the folder and turn > > > on the archive flag using this method. > > This vb program (easily found with google) might inspire you ;-)http://www.visualbasic.happycodings....es_Drives/code... > WMI does this pretty easily. Get the WMI Code Creator. Google for > it. It's a real time saver. > > strComputer = "." > Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root > \CIMV2") > Set objShare = objWMIService.Get("Win32_Directory.Name='c:\'") > Set objOutParams = objWMIService.ExecMethod("Win32_Directory.Name='c: > \dell'", "Compress") > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Retrieve File System Object Descriptions For Executables | PowerShell | |||
| Re: Compress Folder to a single file? | VB Script | |||
| Re: Compress Folder to a single file? | VB Script | |||
| Re: Compress Folder to a single file? | VB Script | |||
| Compress a Folder or File | Tutorials | |||