| |
netman06
Posts: 107
Score: 0
Joined: 10/19/2006
Status: offline
|
Hello, How would I go about coping a folder from a cdrom that can change from system to system, to the local C Drive. I understand how to copy files and folders, but do not understand how to referenance the system cdrom drive, that changes from system to system. Thanks for your help. Mike I found this script and trying to make it work, but having trouble getting the file from the cd rom drive. I think the problem is with this line of code. objFSO.CopyFile ("Drive.DriveLetter") & "\licenseterms.txt" Whole script here Const DriveTypeCDROM = 4 Set objFSO = Wscript.CreateObject("Scripting.FileSystemObject") Set oDrives = objFSO.Drives 'Loop thru A-Z. If found, exit early. For Each Drive in oDrives If Drive.DriveType = DriveTypeCDROM Then Wscript.Echo Drive.DriveLetter objFSO.CopyFile ("Drive.DriveLetter") & "\licenseterms.txt" , "C:\Program Files\keys\" End If Next I found my problem: objFSO.CopyFile ("Drive.DriveLetter") & ":\licenseterms.txt" Now I have a new problem, getting the attrib's of read-only off of the file so that I can copy it to the c: drive. Any ideas. Thanks, Mike
< Message edited by netman06 -- 9/22/2008 1:44:32 PM >
|
|