It works, but possibly Pegasus can correct my bad scripting habits
@echo off
set loc1="C:\Program Files\Microsoft Office\Office11\OIS.exe"
set loc2="C:\Program Files\Microsoft Office\Office12\OIS.exe"
set loc3="C:\program files\Microsoft Office\ART\Office12\OIS.exe"
if exist %loc1% (
call :regadd %loc1%
)
if exist %loc2% (
call :regadd %loc2%
)
if exist %loc3% (
call :regadd %loc3%
)
goto end
:regadd
reg add <keyname> /v <valuename> /d %1
:end
"JAW" wrote:
> I have a script that at the end must copy a file from one server to
> another server.
>
> I mapped a network drive via NET USE and saved the credentials and it
> works great!
>
> However, when I run the job (using the same account) as a scheduled
> task the copy fails. It works fine on a local drive but not on a
> networked driver. I get a 76 return code from the the copy.
>
> Below is the area of the code that fails.
>
> ' FTP good backup copy and check for success
>
> Const OverwriteExisting = TRUE
> objFSO.CopyFile v_backup,v_xbackup,OverwriteExisting
> objFSO.CopyFile v_output,v_xoutput,OverwriteExisting
>
> v_returncode = err.number
>
> If v_Returncode = 0 then
> WScript.echo "FTP return code =" & v_ReturnCode
> Else
> WScript.echo "FTP return code =" & v_ReturnCode
> WScript.echo "FTP command errored out"
> Call emailer
> v_msg = "Process Completed: " & time
> WScript.Echo v_msg
> Wscript.Quit 1
> End If
> .
>
|