A
Angel Tsankov
Hello,
OK, first question: what if I need to pass arguments to the executable
and I do not know their number in advance?
I have a simple batch file that prints the PATH environment
variable: @echo off
echo %PATH% [ ]
None. Sorry, I use neither XP nor the Task Scheduler (W2K
here). That is certainly odd. Perhaps your very-long-PATH can
and should be shortened considerably? Not that this is an
explanation of course. Did you try echo/redirect %PATH% to a
file?
Same result - only the first 1024 characters are echoed.
Besides, I cannot shorten my PATH as I access my programs via
the run menu, from the command prompt and batch files. Putting
the respective paths in the PATH variable seems to suits these
needs very well.
1510 characters in a PATH is (pardon me) ridiculous. I can't even
imagine how in practice that can be. There are many methods to
reduce the number of FQ directoy paths needing to be in PATH. Even
if one works from CMD a lot. For one, place all your batch or
other CLI script files in one or two directories "not too deep"
(eg c:\util C:\batch c:\scripts or similar). If an application has
need of very long or multiple paths in PATH, then start it from a
batch file instead and include the setting of those locations into
a more restricted and focus PATH variable also set inside the batch
file. It seems you may be misusing the PATH on your system
especially when you consider that every PATH search needs to
"walk" through all of them until a "hit" occurs.
Example: (not start in col 2, it wrapped)
@echo off
SETLOCAL
SET PATH=%SYSTEMROOT%\SYSTEM32;%SYSTEMROOT%;Q:\someapplication
\deepdir1\deepdir2\bin
START "" "Q:\someapplication\deepdir1\deepdir2\bin\someapp.exe"
EXIT
Line 2 is optional
A
CD /d Q:\someapplication\deepdir1\deepdir2\bin
START "" someapp.exe"
may also be suffient.
Also, Shortcuts that specify the Working Directory ("Start In") can
be used in many cases.
Not bashing you or your system and there is much I do not know, but
you should IMHO consider the points and try to shorten your PATH
even above and beyond the TaskScheduler issue.
Hmm, good point and I'll definitely give a good deal of thought.
Thanks a lot!
OK, first question: what if I need to pass arguments to the executable
and I do not know their number in advance?