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 ..
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Hi.

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
Answered 03/30/2007 by: jamsek19
Orange Senior Belt

Please log in to comment
0
if you need to copy during deferred phase you can get App data folder from environment:

Just a word of caution - this may not work if you use Deferred In System Context as most of the more common environment variables will generally not be defined in that particular context.

Regards,

Spartacus
Answered 03/30/2007 by: spartacus
Black Belt

Please log in to comment
0
Spartacus,
thanks for information.
Now I understand why one of my script fails ;-)
Is this because of System account settings or because script is running in deferred in system context sequence?

Best regards

Andreo
Answered 03/30/2007 by: jamsek19
Orange Senior Belt

Please log in to comment
0
Most likely due to the deferred in system context you have selected. Have you tried out the script just deferred but not in system context ?

Regards,

Spartacus
Answered 03/30/2007 by: spartacus
Black Belt

Please log in to comment
Answer this question or Comment on this question for clarity