Page 1 of 1 1
Topic Options
#209569 - 2014-10-22 03:10 PM Can't execute Shell
marvince Offline
Fresh Scripter

Registered: 2006-05-16
Posts: 19
Loc: Northern Hemisphere
I have this strange issue on a Windows 7 computer where the command NETDOM.EXE works fine when called directly from the command line but is not found (and can’t run) when called from a KIX script.
Initially, I tried to call NETDOM from a Kix SHELL command and got this error:
See first screenshot
This is not possible it can’t find the command NETDOM.EXE…

So I did a few tests:
1) launch a CMD prompt as administrator
2) type netdom, works OK
3) in a kix script, test if netdom.exe can be found
4) result is Kix can’t find netdom.exe which is the same command called from the command line??
See second screenshot
I don’t know what to think…
Must be a Windows issue, not a Kix issue, but what is it since I can run it from the same command line OK.
Sorry for the French screenshots, running Windows 7 in French...


Attachments
337.jpg
Description:

338.jpg
Description:




Edited by marvince (2014-10-22 03:14 PM)

Top
#209570 - 2014-10-22 04:14 PM Re: Can't execute Shell [Re: marvince]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4574
Loc: USA
The problem you are likely running into is kix is a 32 bit process, and you are running it on a 64bit OS. Windows (by default) redirects 32bit processes to look in %systemroot%\syswow64 instead of system32, and makes it appear as though files that are most definitely there, are not.

You have a couple of options:
$RC=setoption("Wow64FileRedirection","off")

or use sysnative, ie
 Code:
if exist("%systemroot%\sysnative\drivers\etc\hosts.")
  "found"
else
  "not found"
endif


More info on both of these suggestions can be found in the following thread:
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=187063#Post187063
_________________________
(... better days ahead)

Top
#209571 - 2014-10-22 04:42 PM Re: Can't execute Shell [Re: Allen]
marvince Offline
Fresh Scripter

Registered: 2006-05-16
Posts: 19
Loc: Northern Hemisphere
Wow, I didn't realize 32/64 would make a difference in scripting!
Thank you Allen, this solved the issue!

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.054 seconds in which 0.026 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org