| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
XP Batch File
Introduction
My pc is an Intel cpu running Windows XP pro. the LAN is ethernet 100Mbit/s with an Intel File server and Windows NT 2003. I intend to serve Access mdb data using HTML and ASP. As I have met problems connecting to F:\...\*.mdb I intend to use c:\ as web and database server. This should be faster as paging to F:\ is omitted. Initial attempts are promising. Problem This is all very well and good but c:\ is not backed up whilst F:\ is. So I wrote a script to copy the files from c:\ to F:\ which worked, as you would expect. So I wrote the script in Notepad and saved it as c:\Batch\xcopy.bat. In short it doesn't work. Start -> Run -> c:\Batch\xcopy.bat opens C:\Windows\System32\cmd.exe, DOS box pops up and cycles interminably through the first line even if it is commented out. No files are copied. I have not set XP up in any way - no unusual configuration. Question What am I to do, I just feel that there is something quite simple that I have overlooked? Please help - if you can get me going on one batch file I should be able to add others in the same way and that will simplify life. Many thanks ScriptHam. Code:
xcopy c:\inetpub\wwwroot\cLIMS F:\dat1916\LIMS\c_wwwroot_copy /D /E /K /W /V xcopy c:\inetpub\wwwroot\Default.htm F:\dat1916\LIMS\c_wwwroot_copy /D /E /K /W /V ::END :: prepared 01/12/04 to copy the FK20 files :: and to copy some c:\inetpub files to F:\...\LIMS for backup. :: At the moment the idea is to addnew on F:\ and to copy this to c: for Lookup. :: Longer term that may be reversed using c:\ for main storage. :: To be extended in scope to run at fixed times, to produce a log file on F:\ etc. :: Problem History :: Opens C:\Windows\System32\cmd.exe. Cycles interminably through the first line even if it is commented out. :: No files are copied. Note it works fine fromthe command line interface. |
|
#2
|
||||
|
||||
|
Rename your batch file. Typing XCOPY at a prompt will call the native XCOPY program. Rename your batch file to MYXCOPY.BAT and try again
__________________
selwonk If I've posted some code above, you might think it looks a bit simplistic. It might be. I'd rather people tried the next step themselves rather than getting a full solution on a plate. That way they learn more! |
|
#3
|
||||
|
||||
|
In fact, if the batch file is called XCOPY, when it runs XCOPY within itself, it is probably calling itself over and over again
|
|
#4
|
|||
|
|||
Yes yes yes.Reserved words and file names eh. I'm much obliged Selwonk Thanks. |
|
#5
|
||||
|
||||
|
No problem at all
|
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > XP Batch File |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|