Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Copy folder from a CDROM to C Drive

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,64466
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Copy folder from a CDROM to C Drive
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Copy folder from a CDROM to C Drive - 9/22/2008 11:40:04 AM   
  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 >
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Copy folder from a CDROM to C Drive Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts