Hi,
I 've created a project with batch files...
When I've finished this all worked good, but now if I start the index file (the file that start the program) he says me that choice doesn't exist...
A few months ago it worked on double click, now it doesn't work
If I start it clicking "start as an administrator" choice works, but it has another problems (ex. other batch files location)...
Can you help me?
What is happened???
Thanks and sorry for the bad english.
Problem with batch file (choice)
Moderator: DosItHelp
Re: Problem with batch file (choice)
Can you help me?
No because you didn't provide the code that causes this error.
Hint: Did you overwrite system variables like PATH?
Steffen
Re: Problem with batch file (choice)
Your PATH environment variable has likely been overwritten or corrupted. The source of that problem may be within your failing script, or it could be elsewhere.
-
- Posts: 240
- Joined: 04 Mar 2014 11:14
- Location: germany
Re: Problem with batch file (choice)
Hello,
if you start your batch by double click, it will run in the current directory where the batch is on it.
your batch will find all proccesses and programs you start in batch with "program parameters ...",
or all relative Filenames - because they are present in this directory.
This corresponds to the command: "pushD directoryName" to set the work directory.
All relatively specified path and file names are then resolved.
Or in Variable "path" there is a reference to this directory, which is searched for the application
and executes the application when found.
if you start this batch as an administrator the current directory that work
this batch in it is: "%windir%\system32%", the application cant be found in
this directory if is not present in it or in "%path%".
The relative paths are no longer found or solved correctly.
in order to start this application from any directory, you must add this application directory
into the "Path" variable And use Pushd WorkingDir.
Note: if you start as an administrator an use: pushd "WorkingDirectory" (in qoutes)
it is useful to take a line like this one:
Phil
if you start your batch by double click, it will run in the current directory where the batch is on it.
your batch will find all proccesses and programs you start in batch with "program parameters ...",
or all relative Filenames - because they are present in this directory.
This corresponds to the command: "pushD directoryName" to set the work directory.
All relatively specified path and file names are then resolved.
Or in Variable "path" there is a reference to this directory, which is searched for the application
and executes the application when found.
if you start this batch as an administrator the current directory that work
this batch in it is: "%windir%\system32%", the application cant be found in
this directory if is not present in it or in "%path%".
The relative paths are no longer found or solved correctly.
in order to start this application from any directory, you must add this application directory
into the "Path" variable And use Pushd WorkingDir.
Note: if you start as an administrator an use: pushd "WorkingDirectory" (in qoutes)
it is useful to take a line like this one:
Code: Select all
if . == . pushd "working Directory"
Phil