Well unless it is bad editing on your part the script HAS to fail.


PHP:
$REPORTUSER = domain1user $ARCHIVEUSER = domain2user $REPORTDRIVE = I: $ARCHIVEDRIVE = J:


Those vars need to be within quotes

I would also HIGHLY recommend that you place this type of header at the top of your script. It will force you to make sure you code cleanly.

PHP:
If Not @LogonMode Break On Else Break Off EndIf Dim $SO $SO=SetOption('Explicit','On') $SO=SetOption('NoVarsInStrings','On') $SO=SetOption('NoMacrosInStrings','On') $SO=SetOption('WrapAtEOL','On')


Again, bad editing????

Code:
$USERPASS = password


Unless you REALLY have to, I would recode the script so that you don't keep issuing the WriteLine over and over. I would attempt to write the log one time when needed only with a single write.


You use a USE statement without checking if the drive is already mapped or not. You should check and verify.

You attempt to use NoVarsInStrings and then you go and do this:

Code:
MD "$ARCHIVEDRIVE@YEAR@MONTHNO@MDAYNO"


You're using GOTO END I would really recode and remove all GOTO statements.

You attempt to remove a file/dir without checking if it exists or if you're even in the correct path/location. Very easy to delete or RD an entire structure if LEN is not correct. i.e. You can start an RD from the root of a drive which will give you the opportunity to rebuild the system if something like that happens.

Please take a crack at making the suggested changes and let us know how it goes please.