|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by nsgguy245 in Norton Ghost Backup Software, Windows Batch Scripting, Windows 2003 Server
I have the following script which I would like to run to automatically to display the first six characters after YUTG for every filename in it's directory. When I run this though, it only displays the first six characters for one file and then terminates. How can I write this so that it cycles through all the filenames in the directory?
For instance, if there are the following files in the directory, I would like the script to echo ABCRTF
YGTHJH
UYHFGY
Example filenames: YUTG.ABCRTF.txt
YUTG.YGTHJH.txt
YUTG.UYHFGY.txt
for /F %%A in ('dir /b YUTG*') Do Set MyVar=%%A
set dirvar=%MyVar:~5,5%
echo %dirvar%
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625