Page 1 of 1 1
Topic Options
#64344 - 2002-04-09 01:33 PM Problems with SetColsole
rbursey Offline
Fresh Scripter

Registered: 2001-06-28
Posts: 30
Loc: Grand Falls-Windsor, NF CANADA
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.
_________________________
Regards, -Rick.

Top
#64345 - 2002-04-09 02:16 PM Re: Problems with SetColsole
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Do a quick search for "RunLogonScriptSync" or check out the FAQ.

W2k - Keep the Window visible on login?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#64346 - 2002-04-09 02:19 PM Re: Problems with SetColsole
Dean R Offline
Starting to like KiXtart

Registered: 2002-03-15
Posts: 115
Loc: Ireland, but Im an Aussie
You need to spell "SetConsole" Correctly
You have it spelled SetColsole in your script
---------------------------------------
$err = SetConsole("ALWAYSONTOP")
$err = SetColsole("FOREGROUND")
$err = SetConsole("SHOW")
_________________________
-------------------------------- When you can take this stone from my hand Gwasshoppa you are read... *yoink* Gwasshoppa? Gwasshoppa? Where did you go? ---------------------------------

Top
#64347 - 2002-04-09 03:46 PM Re: Problems with SetColsole
rbursey Offline
Fresh Scripter

Registered: 2001-06-28
Posts: 30
Loc: Grand Falls-Windsor, NF CANADA
Hi Guys,

Thanks for the suggestions.
I figured it out after. I always find the answer right after I post a question. [Big Grin]

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,
_________________________
Regards, -Rick.

Top
#64348 - 2002-04-09 03:50 PM Re: Problems with SetColsole
rbursey Offline
Fresh Scripter

Registered: 2001-06-28
Posts: 30
Loc: Grand Falls-Windsor, NF CANADA
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.....
_________________________
Regards, -Rick.

Top
#64349 - 2002-04-09 03:59 PM Re: Problems with SetColsole
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
code:
SHELL '%COMSPEC% /C /E:1024 COPY c:\temp\*.kix c:\kixtart >NUL'

_________________________
There are two types of vessels, submarines and targets.

Top
#64350 - 2002-04-09 06:19 PM Re: Problems with SetColsole
rbursey Offline
Fresh Scripter

Registered: 2001-06-28
Posts: 30
Loc: Grand Falls-Windsor, NF CANADA
Jes,

Use Windows for a little while and you forget all of your DOS stuff. [Frown]

I should have remembered this.

Thanks.
_________________________
Regards, -Rick.

Top
#64351 - 2002-04-10 07:14 AM Re: Problems with SetColsole
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
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.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#64352 - 2002-04-10 03:37 PM Re: Problems with SetColsole
rbursey Offline
Fresh Scripter

Registered: 2001-06-28
Posts: 30
Loc: Grand Falls-Windsor, NF CANADA
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! [Mad]

Thanks...
_________________________
Regards, -Rick.

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
1 registered (Allen) and 466 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.044 seconds in which 0.019 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