VB script for placing .dat file in specified location
hi
i need a VB script for placing .dat file in following location :
Documents and Settings\All Users\Application Data\Symantec\Symantec AntiVirus Corporate Edition\7.5
reply..
thanks ..
i need a VB script for placing .dat file in following location :
Documents and Settings\All Users\Application Data\Symantec\Symantec AntiVirus Corporate Edition\7.5
reply..
thanks ..
0 Comments
[ + ] Show comments
Answers (4)
Please log in to answer
Posted by:
jamsek19
17 years ago
Hi.
You can get that folder using
for "C:\Documents and Settings\All Users\Application Data" folder (CommonAppDataFolder is Installer property) or,
if you need to copy during deferred phase you can get App data folder from environment:
To copy a file you can use
Best regards
Andreo
You can get that folder using
destDir = Property("CommonAppDataFolder")
for "C:\Documents and Settings\All Users\Application Data" folder (CommonAppDataFolder is Installer property) or,
if you need to copy during deferred phase you can get App data folder from environment:
Set WSHShellObj = CreateObject("WScript.Shell")
Set EnvObject = WSHShellObj.Environment("PROCESS")
destDir = EnvObject.Item("ALLUSERSPROFILE") & "\Application Data"
Set EnvObject = Nothing
Set WSHShellObj = Nothing
To copy a file you can use
Set FSObj = CreateObject("Scripting.FileSystemObject")
Set srcFileObj = FSObj.GetFile("yoursrcfile.dat")
srcFolderFileObj.Copy destFile, False
If (FSObj.FileExists(destFile)) Then
' Wscript.Echo "Copying done."
Else
' Wscript.Echo "Copying failed. Error " & GetErrMsg
End If
Best regards
Andreo
Posted by:
spartacus
17 years ago
Posted by:
jamsek19
17 years ago
Posted by:
spartacus
17 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.