hello all.
i am looking for help with writing a batch file to copy a xls file from sharepoint.
the name of the xls file changes every day - it updates with a date every day.. but the first 2 words of the file always remain constant.
is it possible to copy this file but use wildcards after the first two words?
for example the file is named... Front Door 2012 Jan 03
tomorrow it will be Front Door 2012 Jan 04 and so forth...
is it possible to write a batch file to copy the file just using Front Door (and then use wildcards?)
thanks.
copy a file using wildcard on source file
Moderator: DosItHelp
-
- Posts: 21
- Joined: 19 Jul 2013 11:35
- Location: Brazil
Re: copy a file using wildcard on source file
Hello parabolam
Try this script below:
I Hope that it help you.
See you
Try this script below:
Code: Select all
@echo off
cls
if exist pipeline.txt del pipeline.txt
:: Generate file path to wildcard by "Front Door"*
dir /b /s "Front Door"* > pipeline.txt
:: Get File Path from pipeline.txt
set /p file=<pipeline.txt
echo %file%
pause
copy "%file%" "C:\Front Door" /Y
if exist pipeline.txt del pipeline.txt
goto:eof
I Hope that it help you.
See you