Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a batch file that uses part of the file name as a variable

Status
Not open for further replies.

PJhacker

Technical User
Jun 8, 2015
3
US
I would like to create a .bat the that reads all of the files in a specific directory and copies them to a unique directory based upon the file name.

Here is a sample of files it my p:\master directory. The directory actually contains approx 500 files

ITM90236.CSV
ITM90236.HST
ITM90254.CSV
ITM90254.HST
ITM90334.CSV
ITM90334.HST
ITM90669.CSV
ITM90669.HST

I want to use the number in the file name and copy the files to that directory P:\Master\90236.

My current batch file has a entry for number.
 
Hi, and welcome to Tek-Tips.

This forum is rather moldy🧀, not having any active postings for years.

Please tell us what BASIC you are using. There are other more current forums here that address various BASICs.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Sorry and thank you, This is not a Basic programming language question. It is a question for Dos / Windows .bat files. I will try to find the correct thread to post this under.
 
Its a Windows question. Search for your version of Windows.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top