VBScripting folder names with space issue's
Posted on 2006-05-31
I have created a VBScript to zip a folder to a file in another folder. So far this has worked as like charm until I cam accross folders with spaces etc...
I have searched high and low....and can not seem to solve this issue. I must be overlooking something, and this should be simple! As the case may be I am in urgent need to complete this script so I have put a 500 point value on it.
Below is the script I have created, you will need the Winzip to complete this task.
NOTE: WE CAN NOT USE THE WINZIP ADDON TO DO COMMAND LINE.............
Set fso = CreateObject("Scripting.FileSystemObject")
Set Wshell = CreateObject("Wscript.Shell")
'delete if exists folder
Set fld =fso. CreateFolder("c:\test")
'folder and files to capture
Set fld0 = fso.GetFolder("C:\Program Files\Windows NT") ' this seems to get truncated and will not zip up
' zip the files
Wshell.Run "winzip -min -a -r C:\test\winnt.zip " & fld0
Set Wshell = Nothing
Set fld = Nothing
Set fld0 = Nothing
Set fso = Nothing