Computing.Net > Forums > Programming > BATCH: Filename from absolute path

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

BATCH: Filename from absolute path

Reply to Message Icon

Name: carlyman
Date: September 16, 2008 at 13:40:37 Pacific
OS: DOS
CPU/Ram: P4 - 2GB
Comment:

I'm passing an absolute path (e.g. c:\folder\file.txt) as a variable to my batch script. Is there a way to get just the filename (file.txt) from this variable?

Thanks,
JC



Sponsored Link
Ads by Google

Response Number 1
Name: carlyman
Date: September 16, 2008 at 13:55:16 Pacific
Reply:

Search for an hour, can't find anything. Post something to the forum...find it in 15 secs.

Geesh. Just have to use %~nx1


0

Response Number 2
Name: Mechanix2Go
Date: September 16, 2008 at 15:07:05 Pacific
Reply:

not in DOS


=====================================
If at first you don't succeed, you're about average.

M2


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: BATCH: Filename from absolute path

Batch files: Get absolute path www.computing.net/answers/programming/batch-files-get-absolute-path/18251.html

Run and compile Java file in VB6? www.computing.net/answers/programming/run-and-compile-java-file-in-vb6/15563.html

how to call a batch file from html www.computing.net/answers/programming/how-to-call-a-batch-file-from-html/1539.html