Juan Lanus wrote:
Gerald Lai eecs.oregonstate.edu> writes:
One more thing you can try. Run Sysinternal's Filemon at
http://www.sysinternals.com/Utilities/Filemon.html
The filemon program shows that:
this program does this to this path & this happens
vimrun.exe:816 QUERY INFO >C:\WINNT\system32\cmd.exe \e:8192.com< PATH NOT FOUND
vimrun.exe:816 QUERY INFO >C:\WINNT\system32\cmd.exe \e:8192.exe< PATH NOT FOUND
vimrun.exe:816 QUERY INFO >C:\WINNT\system32\cmd.exe \e:8192.bat< PATH NOT FOUND
vimrun.exe:816 QUERY INFO >C:\WINNT\system32\cmd.exe \e:8192.cmd< PATH NOT FOUND
I imagine that vimrun triggered a system() command for to run
"%SystemRoot%\system32\cmd.exe /e:8192" and that Windows is looking for a
plausible extension for to add to the ending 8192.
The string "C:\WINNT\system32\cmd.exe \e:8192" is my COMSPEC variable, with a /E
option for to have more space for Environment variables.
vimrun is treating the whole COMSPEC content as a path, while it can be a path
with flags: SET ComSpec=%SystemRoot%\system32\cmd.exe /e:8192
After this gvim looks for cmd.exe in several locations. None of them in the good
one, that's set in _gvimrc:
set shell=%SystemRoot%\system32\cmd.exe
A :set shell returns this one, with %SystemRoot% replaced.
The manual (os_dos.txt) says:
The default for the 'sh' ('shell') option is ... "cmd.exe" on Windows NT. If
SHELL is defined, Vim uses SHELL instead, and if SHELL is not defined but
COMSPEC is, Vim uses COMSPEC. Vim starts external commands with " /c
".
If I delete the /E:8192 option from the COMSPEC system variable then vimrun
works OK. But all my COBOL software will fail ...
IMO this is a bug, specially how gvim is failing to select the shell option
before anything else. Now I'll be able to sleep.
Thanks Gerald.
--
Juan Lanus
TECNOSOL
Argentina
Test case, for Windows NT:
gvim fails to use the shell option in ! commands
1- Add a flag to the COMSPEC system variable, for example /E:8192
2- Add a set shell= in _gvimrc
3- Open a file in gvim
4- !!path fails with a tempfile error
5- :!path fails with a -1 status code in a DOS window
I have an idea: use a gvim.bat file to start gvim.exe. In the gvim.bat
file, make sure there are these lines:
@echo off
setlocal
...
set COMSPEC=C:\WINDOWS\system32\cmd.exe
...
rem the line to start gvim.exe
...
end local
In addition, try not to use vimrun to run your COBOL programs. Use a
command prompt instead.