Page 1 of 1 1
Topic Options
#58929 - 2001-09-08 07:11 AM Sort.exe get problems in Win2k
Anonymous
Unregistered


Dear all,

Last year I find an excellent script from Fabian which collect the user & software & network information.

In one of the line:

SHELL "%Comspec% $CommandOption c:\windows\command\sort.exe < C:\Temp\Tmp1.dat > C:\Temp\Tmp2.dat"

It work excellent in win9x and NT. But you know win2k is about to launch in our school. I just find that the above line will pop up a crash like messagebox and will terminate the script. How can I solve this?

I am sorry that I haven't check will sort.exe are already installed in Win2k the path "c:\windows\command\", but I think if there are no such execute file, kixtart should just by pass.

Thanks for anyone concern.

Gilbert Ng

Top
#58930 - 2001-09-08 07:30 AM Re: Sort.exe get problems in Win2k
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
It's a case of not doing your homework. SORT.EXE is in C:\WINNT\system32\ if install is to default location. Of course, you should never trust that and use the %systemroot% var instead. You cannot be certain of the temp folder location either and should use %temp% for it. Also you do not disclose the value of $CommandOption so must assume it is "/c".

Anyway, the command works with the aforementioned mods.

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#58931 - 2001-09-08 05:08 PM Re: Sort.exe get problems in Win2k
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
FYI..

You probably don't need to specify where SORT is as it either in 9x or NT/2K as it is in the search path.

- Kent

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#58932 - 2001-09-08 06:34 PM Re: Sort.exe get problems in Win2k
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Right you are Kent, stupid me.
Got caught up in giving a lesson on the perils of hard coding paths...

[ 08 September 2001: Message edited by: LLigetfa ]

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#58933 - 2001-09-08 09:14 PM Re: Sort.exe get problems in Win2k
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Well just to be picky

Kyder is right when he says "probably" and Les is right when he says to use the variables (IMHO)...

We have found a few machines in our orginization that would not run any programs from the command prompt that normally would. It turns out that some piece of software had improperly edited the path and caused the windows folder along with a few other folder to no longer be in the path.

Example: the %windir%\notepad.exe in this case would still work but notepad.exe alone would not along with any other programs in the windows folder.

Myself I try to use the Registry or SET variables whenever possible to point to the correct path, but on most machines it should work just by calling it as Kyder says.

Top
#58934 - 2001-09-09 01:09 AM Re: Sort.exe get problems in Win2k
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
None the less, we stray from Gilbert's original problem, that the script bombs and exits. It would be nice to know what message comes up. Also, supposedly works OK in NT. Unless NT was installed to other than default path (WinNT), it shouldn't work there either.

Must confess, I was shooting from the hip. I need to make sure brain is engaged before putting mouth (fingers) in gear! %systemroot% would only work from NT/2K. Win95 has no such variable. the nearest equivalent is %windir%. MurphyProofing is the part of programming I really hate. Having to anticipate waht may go wrong and coding for it.

Gilbert,
Spark up a CMD window and run your script from it. Any KIX message that may flash and disappear will stay in the CMD window. You could add a few print lines and pause with get $ to determine if it is really crashing on that line. Also, try running the script with the /d (debug) switch and step through the script.

Let us know how you make out.

[ 09 September 2001: Message edited by: LLigetfa ]

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.068 seconds in which 0.039 seconds were spent on a total of 12 queries. Zlib compression enabled.

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