Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
.BAT file problem
Message
From
25/08/2015 03:04:09
 
 
To
25/08/2015 02:40:45
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01623636
Message ID:
01623830
Views:
41
>>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.

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

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.
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform