Here is what I ended up with, it works well as I have used the folder name and passed it to a shell. The script finds file over x days old and zips them...
Set fso = CreateObject("Scripting.FileSystemObject")
Set objShell = wscript.createObject("wscript.shell")
'Install path of 7 Zip, ignor if using Environment variables
InstallPath = "c:\New Folder"
'Target Folder created on fly (and deleted, after zip (strDirectory) is created
myTargetFolder = "C:\test\"
'Zip archive location ( Need to create c:\Archive manually )
strDirectory = "c:\Archive\" & "CL_" & replace(date,"/","_")
'Folder to search through
mySourceFolder="c:\scripts"
wscript.echo strdirectory
set demofolder = fso.GetFolder (strdirectory)
set root=fso.getFolder(mySourceFolder)
call folderlist(root)
sub folderlist(grp)
call filelist(grp)
for each fldr in grp.subFolders
set nf=fso.GetFolder(fldr.path)
call folderlist(nf)
set nf=nothing
next
end sub
sub filelist(grp)
subfldr=myTargetFolder & mid(grp,len(mySourceFolder)+1)
if fso.folderExists(subfldr)=false then fso.CreateFolder(subfldr)
for each file in grp.files
if fileTest(file) = true then
file.move subfldr & "\"
end if
next
end sub
function fileTest(item)
fileTest=False
modDate=item.DateLastModified
If DateDiff("d", item.DateLastModified, Now) > 7 Then
fileTest=True
end if
end function
strCommand = "7z a -tzip " & strDirectory & " " & myTargetFolder
wscript.echo strCommand
objShell.CurrentDirectory = InstallPath
strRun = objShell.Run(strCommand, 0, True)
wscript.echo myTargetFolder
fso.deletefolder strdirectory