Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question bout copying using vbscript 1

Status
Not open for further replies.

Cstorms

IS-IT--Management
Sep 29, 2006
556
US
Hello this is just a quick question clarifying an assumption. If I was to make an hta and use it to copy a particular directory from a cd to the local machine would I use the "\\directory" within the script and it will assume the cdrom drive?

I am pretty green to all this so if you could also point me to an example or ideas on how to do this I would be very thankful. Thanks again.
 
You can determine which drive is the CD ROM using script.

Code:
Const CDROM = 4
For Each d in CreateObject("Scripting.FileSystemObject").Drives
  If d.DriveType = CDROM Then 
    WScript.Echo d.DriveLetter & ":\"
  End If
Next

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Thanks for the tip Mark. To lay it out there what I am trying to do is make an hta that.

1.) Copies a folder to a "program files" folder
2.) Waits a bit so it can finish copying then launches a setup from the cd

I have the setup of the hta for what I want it to look like and set the sizing to a particular, all I need now is some advice on what would be a good way to handle controlling launching of the setup file so that it waits until the folder gets copied completely.

Any advice is always welcome. Thanks for reading.
 
Code:
Set objFSO = CreateObject("Scripting.FileSystemObject")
Do While Not objFSO.FileExists("c:\program files\directory\lastfilecopied")
    wscript.sleep 10
Loop

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Once again, you amaze me with your prompt and extremely relevant comments. Thanks Mark have a star.
 
Hello, I had a quick question in reference to this post. If I have my script working perfectly the way I need it to if the folders are on my local hard drive and specify the path c:\path\folder\etc, if I wanted to burn this to a cd how would I put the path in so that it copies from there? Would I just use the objFSO.CopyFolder "\\folder\folder2", "C:\gohere\" Overwrite

thanks for any help!
 
If you want to burn to a CD I would recommend that you look at createcd ( and maybe search this forum since there was a thread related to this a while back.

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Sorry I was just asking for clarification on if i wanted to copy folders from a cd, as in what the pathname would be since it wouldnt have a drive letter (well it would but if I am running the application from the cd), I didnt actually want to burn it as my lack of grammar skills implied.
 
You can use a UNC path as you have typed it. You must use a comma in front of the overwrite and the "overwrite" needs to be boolean, so set it to true like this:

objFSO.CopyFolder "\\folder\folder2", "C:\gohere\", True

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top