I have an interesting problem that I have looked everywhere for an answer and have come up short. Hopefully someone out there can shed some light as to why this is happening.
I have a CD that contains several C++ applications and a batch file that is ran to copy the files to the correct spots using XCOPY. Yes the xcopy operation happens successfully and the new applications are put in the correct spots.
The problem I am having is right after the batch file has finished copying the file over, I close the batch file window, eject the CD, and run any of the newly copied applications from its new location on the computer. I get the Windows error "There Is No Disk in the Drive. Please Insert a Disk into Drive D:". (That is my CD drive's name)
My programs do NOT have any references to any hardcoded/relative paths at all. In fact, once I acknowledge this error 4 or 5 times and reopen the program, I NEVER see the error again. To see the error pop back up again, I have to run the batch file again from the CD and take the CD out before I run the application.
Just for more clarification, doing a manual copy/paste (Ctrl+c, Ctrl+v) of an application from the disk works just fine. If I manually copy/paste and eject the CD, the program works just fine. This error only occurs on the first time the program runs after I copy it over with a batch file and remove the CD before I run the program. Also, restarting the computer after the batch file is ran prevents this problem from happening altogether too.
I know what you are saying, if restarting the computer after copying the file over fixes the problem, then why is he asking this question here? Well, I have to copy this file on 30+ non-networked computers at a time and it takes a LONG time to restart each of them.
Is there some weird Windows tagging of the applications when they are copied over with XCOPY to where the program still thinks it lives on the CD after being copied over? Does anyone have any suggestions, comments, or links that can point me in the right direction? Any help would be phenominal.
Thanks a lot!
EDIT: I forgot to mention that this is on the Windows XP operating system.
EDIT2: Here is the code for my batch file.
XCOPY "%INSTALLSERVER%Scenario\*.*" "%AppProgramFiles%Scenario\" /C /Y /q
XCOPY "%INSTALLSERVER%Plan\*.*" "%AppProgramFiles%Plan\" /C /Y /q
XCOPY "%INSTALLSERVER%Data" "%AppProgramFiles%Data\" /C /Y /q /e
XCOPY "%INSTALLSERVER%Misc\*.*" "%AppProgramFiles%Misc\" /C /Y /q
As I mentioned above, I can copy/paste the application myself and the program runs just fine. There is NO error if I do it this way. The "No disk in the drive" error ONLY shows up if I copy the application over using a batch file. In fact, I've seen the same problem if I copy an application over using a vbscript file as well. I'm wondering if Windows XP has some strange way of tagging applications that get copied off of a CD using a process like batch/vbscript? Any ideas?