Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
.BAT file problem
Message
De
25/08/2015 01:52:00
 
 
À
24/08/2015 05:51:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01623636
Message ID:
01623823
Vues:
52
>>>I need to do a scheduled batch file but i can't make it work!
>>>its supposed to create a new folder on a drive :\\ott-APV005\edrive\vApp9\vBRS\Capture\%Yr%%Mth%%Day%\
>>>then copy tow files from the current folder to the newly created folder
>>>my .bat creates the folder alright
>>>but the copy does not work, the new folder remains empty
>>>
>>>:-(
>>>
>>>Peter
>>>
>>>echo off
>>>Rem Get Day,Mth & Year from %Date%
>>>set mth=%Date:~4,2%
>>>set day=%Date:~7,2%
>>>set Yr=%Date:~10,4%
>>>set dt=%Yr%%Mth%%Day%
>>>
>>>set srce=c:\prowin3\capture\
>>>set trgt=\\ott-APV005\edrive\vApp9\vBRS\Capture\%Yr%%Mth%%Day%\
>>>
>>>rem make a new dir for today
>>>mkdir %trgt%
>>>
>>>
>>>rem now copy the files into today's folder with the same name
>>>
>>>copy %srce%WEB.bai %trgt%*.*
>>
>>The final COPY command looks incorrect:
>>
>>- the first argument %srce%WEB.bai specifies just one file, in the %srce% folder
>>- there should not be any wildcards in the target, if you're copying multiple files the target should just be a folder
>>
>>I suspect you actually want something like
>>
>>copy %srce%*.bai %trgt%
>>REM which copies all files with the .bai extension to the target folder
>>
>actually there are 2 files per day:
>- WEB.bai
>- Detail with Text Report.BAI2

File names with spaces are generally a PITA in CMD files. If there's a chance you could get the file named something like "Detail_with_Text_Report.BAI2" that would be easier to handle. Nevertheless the following should work:
copy %srce%*.bai* %trgt%
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform