cmd batch or vbs script help

August 27, 2010 at 13:29:13
Specs: WinXP, 2GB
Hi everyone, I am not a scripter guy, but I do need to help with creating script for my company deployment. here is what I want:

I need to have a script when user logon via GPO, it will copy a directory (say Macromedia) folder to C:\Documents and Settings\%username%\Application Data\Macromedia

Condition check: if there is already Macromedia\Flash Player\#Security folder exist, skip to run batch and exit.

I have placed the directory folder onto \\server\share.

How do I accomplish the task?


See More: cmd batch or vbs script help

Report •

September 1, 2010 at 13:36:38
C:\Documents and Settings\%username%\Application Data
Don't do this; the users folder and the apps folder changes between Windows versions, and Windows does not guarantee the user's name will equate to the user's folder. There's no excuse for this method. None.

appDir = CreateObject("WScript.Shell").Environment("Volatile")("AppData")
With CreateObject("Scripting.FileSystemObject")
  If Not .FolderExists(appDir & "\Macromedia\Flash Player\#Security") Then _
    .CopyFolder "\\server\share\Macromedia", appDir & "\Macromedia", True
End With

Report •
Related Solutions

Ask Question