Author Topic: OS Shell command not launching 4NT  (Read 9663 times)

gary_ash

  • Guest
OS Shell command not launching 4NT
« on: September 12, 2007, 03:31:50 pm »
Just noticed this and i think it boils down to spaces in the COMSPEC
4NT's default install path is C:\Program Files\JPSoft\4NT8 which makes my COMSPEC=C:\Program Files\JPSoft\4NT8\4nt.exe
I'd try a maybe_quote myself but this seems to be in the shell command in the binaries.

gb

hs2

  • Senior Community Member
  • Posts: 2736
  • Hero Points: 288
Re: OS Shell command not launching 4NT
« Reply #1 on: September 12, 2007, 04:07:10 pm »
I afraid the COMSPEC is 'somehow' hardwired to 'cmd.exe'. I digged into it b/c I also didn't get it working time ago.
@see start_process2():
Code: [Select]
   } else if (machine()=='NT386') {
      if (def_ntshell=='') {
         _str command=get_env('COMSPEC');
         if (!pos('cmd.exe',command,1,'i')) {
            command=path_search('cmd.exe','','P');
         }
         status=concur_shell(command' /q');
      } else {
         status=concur_shell(def_ntshell);
      }
   }

So if you set-var def_ntshell <path-to>'4nt.exe you can force SE to use 4nt. (SPACEs shouldn't matter.)

HS2

gary_ash

  • Guest
Re: OS Shell command not launching 4NT
« Reply #2 on: September 12, 2007, 04:33:57 pm »
thanks for the reply
I've just gotten the OS Shell command to work by putting quotes in my comspec and for now that's good enough
It would be nice if SlickEdit used 4NT in it's shell window but i understand that it is a non standard shell
Windows PowerShell would also be nice since that's a Microsoft addon



evanratt

  • Senior Community Member
  • Posts: 300
  • Hero Points: 23
Re: OS Shell command not launching 4NT
« Reply #3 on: September 12, 2007, 04:45:38 pm »
Because our build process uses some 4nt specific commands, I also like to have 4nt running in SlickEdit's process buffer. I've added the following to my project properties "Open" commands, which seems to work well enough for me.
Code: [Select]
concur_command c:\4nt500\4nt.exe

-Evan

hs2

  • Senior Community Member
  • Posts: 2736
  • Hero Points: 288
Re: OS Shell command not launching 4NT
« Reply #4 on: September 12, 2007, 04:51:16 pm »
@evanratt: This could be achieved by 'set-var def_ntshell <path-to>4nt.exe'. - HS2

evanratt

  • Senior Community Member
  • Posts: 300
  • Hero Points: 23
Re: OS Shell command not launching 4NT
« Reply #5 on: September 12, 2007, 04:59:12 pm »
I just realized that when I re-read your post - I had originally thought it would just change the shell launched with the OS Shell command. Great catch!

Now my OS Shell command seems to be erroring out with "Path not found"... hmm. Oh well, I've got a windows hotkey shortcut to 4nt to launch a shell window, so that doesn't bother me too much...

Thanks, HS2!

hs2

  • Senior Community Member
  • Posts: 2736
  • Hero Points: 288
Re: OS Shell command not launching 4NT
« Reply #6 on: September 12, 2007, 10:41:26 pm »
I think you should also add this to your <VSLICKCONFIG>\vslick.ini
sample:
Code: [Select]
; force comspec to 4nt.exe (maybe quote path) - @see set-var def_ntshell
COMSPEC=D:\Tools\Misc\4NT\4nt.exe

No problem here running a 4nt 'OS Shell'.

HS2

evanratt

  • Senior Community Member
  • Posts: 300
  • Hero Points: 23
Re: OS Shell command not launching 4NT
« Reply #7 on: September 12, 2007, 10:46:33 pm »
Thanks hs2, that was my problem. Apparently I already had that line there, but had forgotten about it when I copied my configuration over to a new computer, where 4nt was installed to a different directory.

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: OS Shell command not launching 4NT
« Reply #8 on: September 13, 2007, 04:14:19 pm »
If I set COMSPEC in vslick.ini, I can't type in to the Build window.  If I type "dir", nothing happens except for the "File not found" message in the status bar.

If I set def_ntshell to "C:\Program Files\JPSoft\4NT8\4nt.exe", my builds don't work:
Quote
[C:\PROGRA~1\SLICKE~1\win\vsbuild "build" "C:\work\tmplt\tmplt.vpw" "C:\work\tmplt\tmplt.vpj" -signal 9009
VSLICKERRORPATH="C:\work\tmplt\3rdparty\layouttemplate"
nmake -f layouttmplt.mak & type *.err
vsbuild: File not found (C:\MicrosoftVisualStudio8\VC\bin\nmake.EXE)

When I clear def_ntshell, and don't set a comspec in vslick.ini, builds work as expected, and I can type commands in the Build window.

What am I misunderstanding?

hs2

  • Senior Community Member
  • Posts: 2736
  • Hero Points: 288
Re: OS Shell command not launching 4NT
« Reply #9 on: September 13, 2007, 06:00:40 pm »
Strange - it's working flawlessly. Maybe something wrong with your config (4NT.INI, ...) ?
But I'm not an 4nt expert - it just works for me.
What happens if you start 4nt in an existing (cmd) build shell ? Everything ok in that case (nmake found) ?

HS2

evanratt

  • Senior Community Member
  • Posts: 300
  • Hero Points: 23
Re: OS Shell command not launching 4NT
« Reply #10 on: September 13, 2007, 06:05:14 pm »
Could you have something in your 4start.bat file that's resetting your PATH incorrectly?

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: OS Shell command not launching 4NT
« Reply #11 on: September 13, 2007, 06:23:57 pm »
Strange - it's working flawlessly. Maybe something wrong with your config (4NT.INI, ...) ?
But I'm not an 4nt expert - it just works for me.
What happens if you start 4nt in an existing (cmd) build shell ? Everything ok in that case (nmake found) ?

HS2
If I start cmd.exe, then run 4nt.exe w/i cmd.exe, nmake works as expected. 

I don't know if this makes a difference, but 4nt sets comspec=cmd.exe.  Why?  When build tools (like nmake) spawn child processes, it avoids the startup overhead of 4nt for each invocation of the compiler, linker, etc.  I'll have to see if there is a way to suppress some of the startup overhead in 4nt.

Hmmm, when I set comspec to 4nt.exe, nmake fails:
Quote
Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl.exe jnk.cpp
NMAKE : fatal error U1045: spawn failed : No error
Stop.