Computing.Net > Forums > Programming > Writing its own path name

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.

Writing its own path name

Reply to Message Icon

Name: hatlad
Date: June 16, 2007 at 07:45:09 Pacific
OS: windows xp home
CPU/Ram: 510mb RAM Itell pentium C
Product: Dell Custom
Comment:

I have a batch file that finds out its path whereever it is. Wheter it is in my documents or in program files, I want the same file to know where it is. A little help please?

I hope you can help!



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: June 16, 2007 at 10:42:42 Pacific
Reply:

not clear


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

M2



0

Response Number 2
Name: hatlad
Date: June 16, 2007 at 11:10:04 Pacific
Reply:

Well, the batch file is in C:\Documents and Settings\Jim\My Documents\Shirts and it calls another batch file in the same place. I want the first batch file to be able to run the second one if the second one is in C:\Documents and Settings\Bob\My Documents\Pants or C:\Documents and Settings\Jane\My Documents\Hats

I hope you can help!


0

Response Number 3
Name: Mechanix2Go
Date: June 16, 2007 at 11:19:30 Pacific
Reply:

"I want the first batch file to be able to run the second one if the second one is in C:\Documents and Settings\Bob\My Documents\Pants or C:\Documents and Settings\Jane\My Documents\Hats"

So you mean you want the first one to find the second? Or do you want to hard-wire the location of the second?



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

M2



0

Response Number 4
Name: hatlad
Date: June 16, 2007 at 11:40:54 Pacific
Reply:

I want the 1st one to find the second

I hope you can help!


0

Response Number 5
Name: Mechanix2Go
Date: June 16, 2007 at 12:03:13 Pacific
Reply:

If the name is consistent, let's call it my.bat, you can:

::== first.bat
@echo off
setLocal EnableDelayedExpansion

for /f "tokens=* delims= " %%a in ('dir /s/b/a-d "C:\Documents and Settings\my.bat"') do (
call "%%a"
)
::==


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

M2



0

Related Posts

See More



Response Number 6
Name: hatlad
Date: June 18, 2007 at 10:56:44 Pacific
Reply:

does it work if it is in program files or shared documents?

I hope you can help!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Problem with using RXTX o... Coping files from a remov...



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: Writing its own path name

please help www.computing.net/answers/programming/please-help-/9908.html

MFC applicatoin path www.computing.net/answers/programming/mfc-applicatoin-path/11657.html

Help please www.computing.net/answers/programming/help-please/9910.html