# FileCopy Problem

## Recommended Posts

I want to distribute software to PCs on CDs. I thought this would work but it doesn't.

Will someone help?

Func LocateDrive($sPath) Local$aDrive = DriveGetDrive("CDROM")

For $iLetter = 1 To$aDrive[0] Step 1

if FileExists($aDrive[$iLetter] & "\" & $sPath) then return$aDrive[$iLetter] Next Return -1 EndFunc$DriveLetter = LocateDrive("MySetup\Setup.exe")

ConsoleWrite($DriveLetter & @CRLF) DirCreate("c:\web\software") DirCreate("c:\web\in progress") DirCreate("c:\web\hold") FileCopy("$DriveLetter:\website\software\*.*", "c:\web\software",1)

FileCopy("$DriveLetter:\website\*.*", "c:\web\hold",1) FileCopy("$DriveLetter:\website\*.*", "c:\web\in progress",1)

##### Share on other sites

Take a look here:

Hi!

My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

##### Share on other sites

Try this change.

﻿Func LocateDrive($sPath) Local$aDrive = DriveGetDrive("CDROM")
For $iLetter = 1 To$aDrive[0] Step 1
If FileExists($aDrive[$iLetter] & "\" & $sPath) Then Return$aDrive[$iLetter] Next Return -1 EndFunc ;==>LocateDrive$DriveLetter = LocateDrive("MySetup\Setup.exe")
ConsoleWrite($DriveLetter & @CRLF) DirCreate("c:\web\software") DirCreate("c:\web\in progress") DirCreate("c:\web\hold") FileCopy($DriveLetter & ":\website\software\*.*", "c:\web\software", 1)
FileCopy($DriveLetter & ":\website\*.*", "c:\web\hold", 1) FileCopy($DriveLetter & ":\website\*.*", "c:\web\in progress", 1)

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

## Create an account

Register a new account

×

• Wiki

• Back

• Git