Page 1 of 1 1
Topic Options
#110232 - 2003-12-12 09:02 PM Su flashes console........nothing to do.
Jose Offline
Seasoned Scripter
*****

Registered: 2001-04-04
Posts: 693
Loc: Buenos Aires - Argentina
Korgers:
I have tried many ways to stop console flashes whenever I use SU.EXE and WKIX32.EXE but coudnt make -CB switch to work.
Here is the same question posted at Kixforms with a little sample code.

If anybody had made this work please let me know.
Thanks in advance.


Edited by jose3 (2003-12-12 09:04 PM)
_________________________
Life is fine.

Top
#110233 - 2003-12-12 09:04 PM Re: Su flashes console........nothing to do.
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Have you tried to redirect to a NUL?

> nul

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

Top
#110234 - 2003-12-12 09:10 PM Re: Su flashes console........nothing to do.
Jose Offline
Seasoned Scripter
*****

Registered: 2001-04-04
Posts: 693
Loc: Buenos Aires - Argentina
You mean here Kent?
Code:
SU("%COMSPEC% /C ipconfig > c:\temp\temp.txt", $Pass, $userid)


To use > null you mean?

The Ipconfig was just any sample to make su act so as to show the "flash".


_________________________
Life is fine.

Top
#110235 - 2003-12-12 09:10 PM Re: Su flashes console........nothing to do.
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4563
Loc: USA
I don't use SU so I'm unfamiliar with the CB switch... however standard shell commands can be directed to nul by adding "1>nul 2>&1" to the end. This command not only directs standard output to nul, but error output as well. I believe this will only work on NT/2K/XP...
Top
#110236 - 2003-12-12 09:13 PM Re: Su flashes console........nothing to do.
Jose Offline
Seasoned Scripter
*****

Registered: 2001-04-04
Posts: 693
Loc: Buenos Aires - Argentina
AHHH I seee. Sorry kent I missundestudd you.
Thanks very much AL I`ll give a try amd come back.
_________________________
Life is fine.

Top
#110237 - 2003-12-12 09:39 PM Re: Su flashes console........nothing to do.
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4563
Loc: USA
I think the console may be flashing because you are calling the shell to run... it may work by just change this...

Code:
 Function SU($COMMAND,$Pass,$userid) 
SetL "SU_COMMANDLINE="+$COMMAND
SetL "SU_DOMAIN=DOMAIN"
SetL "SU_PASSWORD="+$pass
Shell "%comspec% /c su $userid"
EndFunction



to:

Code:
 Function SU($COMMAND,$Pass,$userid) 
SetL "SU_COMMANDLINE="+$COMMAND
SetL "SU_DOMAIN=DOMAIN"
SetL "SU_PASSWORD="+$pass
Shell "su $userid"
EndFunction



I guess my only question is will su pickup the system variables you are setting before it runs, without opening the %comspec%... Worth a try.

Top
#110238 - 2003-12-12 09:57 PM Re: Su flashes console........nothing to do.
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Shelling to %comspec% should not flash a console when using wkix32.exe.
Top
#110239 - 2003-12-12 10:03 PM Re: Su flashes console........nothing to do.
Jose Offline
Seasoned Scripter
*****

Registered: 2001-04-04
Posts: 693
Loc: Buenos Aires - Argentina
It does, and neither "1>nul 2>&1", nor 'Shell "su $userid"' worked out.

Quote:

I guess my only question is will su pickup the system variables you are setting before it runs, without opening the %comspec%... Worth a try.



I think this is because Su normally promps for password in non-script usage and this way you can settle it....anyway, without %comspec% is the same.

Apresiate the help thought I think this one is tuff to solve.




_________________________
Life is fine.

Top
#110240 - 2003-12-12 10:38 PM Re: Su flashes console........nothing to do.
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
The SU console issue has come up on the board before and IIRC it stumped the panel.
_________________________
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:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2419 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.065 seconds in which 0.03 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