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."
}
This Blog is for all people working or related to the MSI and App-V. There are lots of issues we face in everyday work regarding the technology. The sole purpose of my blog is to help others with whatever I learn. All you people out there, please help by commenting, voting, propagating and sharing my blog with your friends and colleagues but with due credit and acknowledgement to the material posted here with my name and blog url as I still do hold the copyright of the posts here.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment