[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.

Question
[x]
Attachment Details

Windows 2003 Batch Script Processing

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%
[+][-]11/04/09 08:36 AM, ID: 25741074Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 08:40 AM, ID: 25741151Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 09:14 AM, ID: 25741553Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 09:17 AM, ID: 25741582Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 09:18 AM, ID: 25741600Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625