windows - CMD Assigning variable to file name in folder -


i looking way assign filename variable based on wildcard. have far:

cd y:\filelocation\filename1.txt  %%a y:\filelocation\filename1*.txt set claims= %~ni 

not sure if can point file , grab attributes specific file , assign file name. or how can go doing this. need use wildcard since file name can have datestamp, root of file name remain same.

what works me syntax:

 %%a in (d*.lnk) set claims=%%~na 

so change code match works, read...

cd /d "y:\filelocation" %%a in ("y:\filelocation\filename1*.txt") set "claims=%%~na" 

changes made were:
1) added key-word "in"
2) added parenthesis around file specification
3) added key-word "do" , removed new-line
4) changed "%~ni" "%%~na"


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -