I must not have done this right. I now have this in the command key:
cmd /k nmake "%1" && "%~dpn1"
The result was:
'"%~dpn1"' is not recognized as an internal or external command, operable program or batch file
The way this works (1/2 of it anyway) is right-click the mak file and choose Open with command prompt. It compiles and builds just fine. But getting the result (the executable which is the same name as the mak file less the .mak extension replaced with .exe extension) to fire is what I was hoping was going to happen. It compiled and built fine but didn't fire instead the error message above was what resulted.
--
George Hester
_________________________________
"David Candy" <.> wrote in message news:(E-Mail Removed)...
As you are using cmd you can do anything
There is no need for %*, you can ONLY pass a filename so only need %1.
In cmd %1 can be modified.%~n1 is the file name (~ to show we are pulling out parts of the full name, n for name, d for drive, n for name, x for extension. && seperates commands on a line and depends on sucess to execute.
"c:\windows\system32\cmd" /k nmake "%1" && "%~dpn1"
You also haven't given a path to cmd so explorer won't find it (it wants to look to see if it's a win32 aware program so it can decide to pass long/short names) and will pass short names to CreateProcess (which will find Cmd so it will work but with short names as parameters). You really should quote the full path to cmd (although cmd is usually is a folder without spaces - so quotes are optional usually)
Type cmd in help and read the quoting rules. I've found that spaces as delimiters work (normally / & etc are also considered delimeters).
--
----------------------------------------------------------
"George Hester" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
I made a entry in the Windows 2000 registry to compile and build a C program from a make file. Like this:
HKCR\.mak
default: makfile
HKCR\makfile
HKCR\makfile\shell
HKCR\makfile\shell\Open2
default: Open &with command prompt
HKCR\makfile\shell\Open2\command
default: cmd /k nmake "%1" %*
What I would like to do is run the exectable that results. I assume I would need to pipe into that (success) exectable which is the same name as the mak file less the extension with exe of course. Is it possible to do this as I have set it up or maybe I should set this tpo use a bat file and in that run nmake and then the file itself? Either way how can I do this? Of course if the build fails I would like to exit nicely. Thanks.
--
George Hester
_________________________________
|