stevemarks59
Technical User
I have XP-Pro SP3 with Power Shell installed.
I need a script I can drag and drop files and folders onto that will copy them maintaining the attributes of the source.
Specifically most of my folders have distributable custom icons. Each folder contains both a "desktop.ini" file and an associated "FolderMarker.ico" the "desktop.ini" file points to. Both of these files have "system" and "hidden" attributes. In order for the folders to display the custom icons when copied to another computer these files have to keep the "system" attribute and I want the "hidden" attribute maintained as well.
I haven't been able to do this using VBscript. I have to use XXcopy which doesn't allow me to copy by just dropping the folders on the script. (VBscript does allow me to copy by dropping items on the script but the copied folder icons are not distributable because the "system" and "hidden" attributes of the "desktop.ini" and "FolderMarker.ico" are lost when copied by that method.
I would really appreciate a script to accomplish this. Below is the VBscript to which I refer. Thanks.
------------------------------------------------------
On Error Resume Next
Const OverwriteExisting = True
Set objArgs = WScript.Arguments
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objArgs.Count < 1 Then
WScript.Quit
End If
For I = 0 to objArgs.Count - 1
Arg = objArgs(I)
objFSO.CopyFile Arg, "C:\Program Files\", OverwriteExisting
objFSO.CopyFile Arg, "D:\0 aAPPS\00 a Install First\Program Files\", OverwriteExisting
objFSO.CopyFolder Arg, "C:\Program Files\", OverwriteExisting
objFSO.CopyFolder Arg, "D:\0 aAPPS\00 a Install First\Program Files\", OverwriteExisting
Next
WScript.Quit
------------------------------------------------------
I need a script I can drag and drop files and folders onto that will copy them maintaining the attributes of the source.
Specifically most of my folders have distributable custom icons. Each folder contains both a "desktop.ini" file and an associated "FolderMarker.ico" the "desktop.ini" file points to. Both of these files have "system" and "hidden" attributes. In order for the folders to display the custom icons when copied to another computer these files have to keep the "system" attribute and I want the "hidden" attribute maintained as well.
I haven't been able to do this using VBscript. I have to use XXcopy which doesn't allow me to copy by just dropping the folders on the script. (VBscript does allow me to copy by dropping items on the script but the copied folder icons are not distributable because the "system" and "hidden" attributes of the "desktop.ini" and "FolderMarker.ico" are lost when copied by that method.
I would really appreciate a script to accomplish this. Below is the VBscript to which I refer. Thanks.
------------------------------------------------------
On Error Resume Next
Const OverwriteExisting = True
Set objArgs = WScript.Arguments
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objArgs.Count < 1 Then
WScript.Quit
End If
For I = 0 to objArgs.Count - 1
Arg = objArgs(I)
objFSO.CopyFile Arg, "C:\Program Files\", OverwriteExisting
objFSO.CopyFile Arg, "D:\0 aAPPS\00 a Install First\Program Files\", OverwriteExisting
objFSO.CopyFolder Arg, "C:\Program Files\", OverwriteExisting
objFSO.CopyFolder Arg, "D:\0 aAPPS\00 a Install First\Program Files\", OverwriteExisting
Next
WScript.Quit
------------------------------------------------------