To access a file at the location of the EXE

Convert your BATch files into EXEcutable format in one click.
Post Reply
Photofix
Posts: 3
Joined: Thu Jan 22, 2009 9:24 pm

To access a file at the location of the EXE

Post by Photofix »

Is there a way to access a file that is in the same folder as the EXE when it is run.

I have a batch that would be the same for mutli locations but would have site specific settings that I would have in the same folder as the EXE during runtime.
Photofix
Posts: 3
Joined: Thu Jan 22, 2009 9:24 pm

Also....

Post by Photofix »

Better yet,

Is there a variable (i.e. %source%) that would be for the location of where the EXE is located. That way I can save files from the batch and load files from where the EXE is located.
Photofix
Posts: 3
Joined: Thu Jan 22, 2009 9:24 pm

Fixed

Post by Photofix »

Well just leaving any % % out solved the issue with accessing files that were in the same location as the EXE. :oops:

I had a prompt for a filename to load in the batch script that I was writing, and I was trying to verify that the file name was correct and it could never find the file. Most likely due to the fact that the bat file was running from the temp folder. :?

:arrow: SO, if anyone has this question, just enter the filename with no path and it should load/save just fine.

It would be nice if there was a variable that would allow the script to look into the "source" folder, but I guess that would be for the developers to look at for future updates. :D
Post Reply