/build/static/layout/Breadcrumb_cap_w.png

Script to copy file

VBScript to copy file:

dim filesys, oShell
Set filesys = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("WScript.Shell")
sup = oShell.ExpandEnvironmentStrings ("%APPDATA%")
des = oShell.ExpandEnvironmentStrings ("%ProgramFiles(x86)%")
destfile= sup & "\AR System\HOME\AR"
sourcefile= des & "\AR System\User\AR"
If filesys.FileExists(sourcefile) Then
   filesys.CopyFile sourcefile, destfile
End If


Powershell Script to copy file:

$SourceFile = "c:\foo\Test.txt";  
$NewFile    = "c:\foo\Test2.txt";  
  
# Now - check to see if $Sourcefile exists, and if so,  
# copy it to $newfile   
if ([System.IO.File]::Exists($SourceFile))  {  
   [System.IO.File]::Copy($SourceFile, $NewFile)  
   "Source File ($SourceFile) copied to ($newFile)"  
}  
else {  
"Source file ($Sourcefile) does not exist."  
}


Comments

This post is locked
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ