' QUESTO COMANDO DEVE ESSERE AVVIATO COME UTENTE BACKUP disco_destinazione = "\\BACKUP\EXCHANGE\EXMERGE" on error resume next set w=createobject("wscript.shell") set fso=createobject("scripting.filesystemobject") Set jc = New JobControl anno = year(now) if wscript.arguments.count > 0 then if isnumeric(wscript.arguments(0)) then anno = wscript.arguments(0) end if end if select case WeekDay(now) case 1,3,5 pathdestinazione = disco_destinazione & "\LUN-MER-VEN\" & anno case 2,4,6 pathdestinazione = disco_destinazione & "\MAR-GIO-SAB\" & anno end select wscript.echo pathdestionazione esegui "ExMergeIni.exe DataDirectoryName " & pathdestinazione & " -f .\ExMerge.ini" esegui "ExMergeIni.exe SelectMessageStartDate ""01/01/" & right(anno,2) & " 00:00:00"" -f .\ExMerge.ini" esegui "ExMergeIni.exe SelectMessageEndDate ""12/31/" & right(anno,2) & " 23:59:59"" -f .\ExMerge.ini" if fso.folderexists(disco_destinazione) then fso.createfolder (pathdestinazione) esegui "exmerge.exe -F exmerge.ini -B -D" end if function esegui(cmd) dim oexec wscript.echo "*** " & now & " *** " & vbcrlf & cmd set oexec = w.exec (cmd) Do until oexec.status <>0 wscript.echo oExec.StdOut.Readline If oExec.StdOut.AtEndOfStream Then WScript.Sleep 100 end if Loop end function