executable for cmd not in path?

D

Dick Watson

I'm trying to add an external command line utility (fsum.exe from slavasoft)
to a WinXP system but do not want to just dump the executable in
%SystemRoot%\system32 for reasons of traceability as to how all of the
add-in stuff like this got on the system. But I also don't want to add
%ProgramFile%\misc\fsum (wherein I document the source of the code, etc) to
the system environment path in order to avoid the path getting any more out
of hand than it already is and to avoid adding lots of directories (where
anything will be run from) to the path when I just want to be able to find
one specific executable.

I've tried creating a .lnk in %SystemRoot%, but cmd doesn't follow these.
I've tried registering
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App
Paths\fsum.exe with a default REG_EXPANS_SZ pointing to the executable, but
cmd also appears to ignore these.

What is the "best practice" way to get a specific external command in the
path? Just put a copy of the executable in %SystemRoot% or
%SystemRoot%\system32?
 
A

Ayush

Dick Watson wrote ::
I'm trying to add an external command line utility (fsum.exe from slavasoft)
to a WinXP system but do not want to just dump the executable in
%SystemRoot%\system32 for reasons of traceability as to how all of the
add-in stuff like this got on the system. But I also don't want to add
%ProgramFile%\misc\fsum (wherein I document the source of the code, etc) to
the system environment path in order to avoid the path getting any more out
of hand than it already is and to avoid adding lots of directories (where
anything will be run from) to the path when I just want to be able to find
one specific executable.


Create a .bat or .cmd file in one of the folders listed in paths and use
the bat file to launch your exe with params.

Bat Ex:
start /d"C:\Program Files\misc\fsum" fsum.exe "%1" "%2" "%3" "%4" "%5"



Good Luck, Ayush.
 
D

Dave Patrick

What process calls it? Why not call it using the fully qualified path?

%ProgramFile%\misc\fsum.exe

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
 
D

Dick Watson

Typing in a cmd shell. That's why forcing the user to use a hard path is not
really attractive.
 
D

Dick Watson

This is probably the best approach. But I' want to use %* so that I can pass
all the params without regard to how many there are.

Great idea! It hadn't even occurred to me... Thanks!
 
D

Dave Patrick

Forcing the user to a command prompt in-of-itself might be a problem. Why
not create a shortcut? If you need the window kept open then;

cmd /k %ProgramFile%\misc\fsum.exe

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
 
D

Dick Watson

Without the parameters, fsum is useless. Short of putting a whole UI on it,
it's really just an external command. The users are people like me who don't
mind typing commands.
 
A

Ayush

Dick Watson wrote ::
This is probably the best approach. But I' want to use %* so that I can pass
all the params without regard to how many there are.

Great idea! It hadn't even occurred to me... Thanks!


You are welcome.



Good Luck, Ayush.
 
D

Dave Patrick

OK, gotcha. You could probably capture the arg string using input box with
VBScript and call it that way.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top