|
Please be gently new to scripting. I have part of my script that I am trying to run. I need to know if you can pass a variable to robocopy.
$LocalPath = ReadValue("HKLM\software\Lotus\Notes" , "DataPath") $ArchPath = $LocalPath + "Archive" $Name=Split (@FULLNAME) $name[0]=Left($name[0],1) $name[1]=Left($name[1],5) $Uname=Join($name,'') + ".nsf" $Uname="arch_" + $Uname $dest= "\\gideon\testarch "
$cmds='" ' + $archpath + '"' + ' ' + $dest + '"" + $uname + '"'
Shell 'robocopy' $cmds
When I run it, it flashes and does nothing. When I try to use %COMPSPEC% it tells me %COMSPEC% is not a valid command. If I run Shell 'robocopy "C:\Program Files\Lotus\Notes\Data\Archive" "\\gideon\testarch" arch_tedwar.nsf"' it runs perfectly. This is the same format I am trying to pass with the varible $cmds. Any help will be appreciated.
|