rbursey
|
(Fresh Scripter)
|
2002-04-09 01:33 PM
|
|
|
|
|
Problems with SetColsole
|
|
Hi All,
I seem to be having some problems with this following code snibett: code:
:StartUp ;********************************************************************** ;** ** ;** Set any GLOBAL variables and configure initial settings ** ;** ** ;** Abitibi-Consolidated, Inc. Grand Falls Division ** ;** ** ;** Created: May 21, 2001 Rick Bursey ** ;** ** ;**********************************************************************
Dim $err, $key
$err = SetConsole("ALWAYSONTOP") $err = SetColsole("FOREGROUND") $err = SetConsole("SHOW")
Break Off
$key = "HKEY_CURRENT_USER\SOFTWARE\ACI-GF\Settings\"
; Get Some User/Worstation/Network Information from our Registry Keys $PG = ReadValue($key + "User Info", "Primary Group") ; User's Primary Group $Priv = ReadValue($key + "User Info", "Privledge") ; User's System Privledges $FName = ReadValue($key + "User Info", "User Name") ; Users Full Name $UserId = ReadValue($key + "User Info", "UserID") ; Users ID $Service = ReadValue($key + "User Info", "Comment") ; Group name assigned from comment field $IPA = ReadValue($key + "Workstation Info", "IP Address") ; The User's Workstation IP Address $WkSta = ReadValue($key + "Workstation Info", "Workstation Name") ; User's Workstation Name $LPath = ReadValue($key + "Network", "Logon Path") ; Get Logon Server Path $LServer = ReadValue($key + "Network", "Logon Server") ; Get Logon Server $Domain = ReadValue($key + "Network", "Local Domain") ; Domain $VPN = ReadValue($key + "Network", "VPN Status") ; Connected Via VPN? $RAS = ReadValue($key + "Network", "RAS Status") ; Connected Via RAS?
CLS
Small ; Draw the boxes on the screen Color y+/b Box (0,0,2,79,DOUBLE) Color b+/b Box (3,0,23,79,GRID) ; 'background grid' Color b/n Box (10,11,21,71,Å) ; 'shadow' of the box Color g+/b Box (9,10,20,70,FULL)
Color w+/b AT ( 1,14) " Abitibi-Consolidated of Canada, Grand Falls Division "
;$Theme = "Have a Safe Month" ; Default Monthly Theme ;$INIFile = "c:\temp\kixtart\logon\modules\safety.ini" ; Create Path to the safety Mesages ;$MDNo = @MDayNo ; Month Day Number ;$Mon = @Month ; Current Month
;$Theme = ReadProfileString($INIFile,"$Mon","theme") ;$SafetyMsg = ReadProfileString($INIFile,"$Mon","msg$MDNo")
;Color w+/b ;AT (7,20) "$Mon is $Theme Month" Color b/n Box (5,11,7,71,Å) ; 'shadow' of the box Color y+/b Box (4,10,6,70,SINGLE) Color w+/b AT (5,18) "Please Wait for Your Logon Script to Complete"; $SafetyMsg
Color w+/b AT (10,20) "Userid : " ; display some text strings AT (11,20) "Full name : " AT (12,20) "Privilege : " AT (13,20) "Primary Group: " AT (14,20) "Workstation : " AT (15,20) "Domain : " AT (16,20) "Logon Server : "
Color y+/b AT (10,35) $UserID AT (11,35) $FName AT (12,35) $priv AT (13,35) $PG AT (14,35) $WkSta AT (15,35) $Domain AT (16,35) $LServer
:END Exit(0)
We are using Win2K clients and it seems for some reason the text window does not become visible. It is always minimized on the desktop. The only way I can get it to become visible is to SetColsole("MAXIMIZE"). I don't want it maximized just visible in normal size.
Anyone have any ideas on how to resolve this?
Thanks.
|
Les
|
(KiX Master)
|
2002-04-09 02:16 PM
|
|
|
|
|
Re: Problems with SetColsole
|
|
Do a quick search for "RunLogonScriptSync" or check out the FAQ.
W2k - Keep the Window visible on login?
|
Dean R
|
(Starting to like KiXtart)
|
2002-04-09 02:19 PM
|
|
|
|
|
Re: Problems with SetColsole
|
|
You need to spell "SetConsole" Correctly You have it spelled SetColsole in your script --------------------------------------- $err = SetConsole("ALWAYSONTOP") $err = SetColsole("FOREGROUND") $err = SetConsole("SHOW")
|
rbursey
|
(Fresh Scripter)
|
2002-04-09 03:46 PM
|
|
|
|
|
Re: Problems with SetColsole
|
|
Hi Guys,
Thanks for the suggestions. I figured it out after. I always find the answer right after I post a question.
Anyway this is what I did: code:
$enable = "1" $key = "'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
; This setting defines whether the system should wait for the logon scripts to complete before ; starting the users shell or whether the scripts should run asynchronously. If (ExistKey($key) = 0) $err = WriteValue($key,"RunLogonScriptSync",$enable,"REG_DWORD") Else EndIf
$err = SetConsole("ALWAYSONTOP") $err = SetConsole("FOREGROUND"); SPELLING MISTAKE BEFORE $err = SetConsole("SHOW")
Thanks again,
|
rbursey
|
(Fresh Scripter)
|
2002-04-09 03:50 PM
|
|
|
|
|
Re: Problems with SetColsole
|
|
Another question:
How do you hide the output from a SHELL statement from being displayed in a text box?
I have a SHELL command running in one of my scripts that copies files but I don't want the output to be shown on the screen. I tried this test script: code:
Dim $err
$err = Shell "%COMSPEC% /C COPY c:\temp\*.kix c:\kixtart"
But it don't work. Any ideas on this one?
Thanks again.....
|
|
Re: Problems with SetColsole
|
|
code:
SHELL '%COMSPEC% /C /E:1024 COPY c:\temp\*.kix c:\kixtart >NUL'
|
rbursey
|
(Fresh Scripter)
|
2002-04-09 06:19 PM
|
|
|
|
|
Re: Problems with SetColsole
|
|
Jes,
Use Windows for a little while and you forget all of your DOS stuff.
I should have remembered this.
Thanks.
|
MCA
|
(KiX Supporter)
|
2002-04-10 07:14 AM
|
|
|
|
|
Re: Problems with SetColsole
|
|
Dear,
FYI: additional info
For spelling problems we have upgrade our kixref tool. For different kixtart releases we have different kixref releases. What does it: - shows all kind of keywords which can be "unknown" for kixtart. - shows linenumbers for possible problems. - shows summary report about keyword types and block structures. Our call was: kixref400.exe input.kix output /warnings Output for your script
code:
Warnings about unknown keywords
b ? 40 42 42 44 46 49 62 64 66 69 78 double ? 41 full ? 47 g ? 46 grid ? 43 n ? 44 62 setcolsole ? 15 single ? 65 w ? 49 66 69 y ? 40 64 78
Summary
boldsymbols 0 commands 7 functions 4 labels 2 macros 0 variables 14
env 0 udf 0 ? 10
gosub 0 goto 0
37
Block Structure
do:until [0:0] for|each:in|to:step|next [0|0:0|0:0|0] function:endfunction [0:0] if:else:endif [0:0:0] select:case:endselect [0:0:0] while:loop [0:0]
0 blocks
remarks about: - b, g, n, w & y are related to "color" statement. - double, full,grid & single are related to "box" function. advise to present them as string (see also documentation) - setcolsole is a spelling problem.
greetings.
|
rbursey
|
(Fresh Scripter)
|
2002-04-10 03:37 PM
|
|
|
|
|
Re: Problems with SetColsole
|
|
I had cut-n-pasted the script into my messages EXCEPT that one line and thet's where the spelling mistake came from.
Spelling is NOT my strong point!
Thanks...
|