Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
.BAT file problem
Message
De
25/08/2015 06:06:18
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
25/08/2015 03:04:09
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:
01623833
Vues:
45
>>>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%
>>>
>>
>>Аhem...
>>
>>
>>copy "%srce%*.bai* "%trgt%"
>>
>
>I tested interactively before I posted. I had a folder with some .txt files that started with the letter "c", some of which included spaces in the file name. I ran
>
>copy c*.txt {destination folder}
>
>All the files, including the ones with spaces, copied as expected.

My correction was only for the case when %trgt% itself contains spaces.

>I also thought about wrapping with double quotes, dunno how that would affect things. I think you missed one in your post, anyways ;)

I thought you put it there but forgot the first one... now I see that that was an asterisk. Actually I don't know why I keep UT on such a small font (now I know: to prevent horizontal scrolling). There... and everything still fits.

>Just this afternoon I ran into a case where double quotes were needed. If you're willing to put plaintext credentials in a CMD file you can automate drive mapping to remote machines not on the same domain e.g.
>
>NET USE F: \\SomeServer\SomeShare MyPassword /USER:SomeDomain\SomeUserAccount /persistent:y
>
This afternoon it turned out the password ended in "?". The NET USE command kept throwing errors about bad account name or password. After I wrapped the password in double quotes, all was well.

The eternal question, just like all the formats where data are to be represented as text, is still "what are the data and what are the delimiters between data and metadata".

Waiting for a password with a quotation mark in it...

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform