Page 1 of 1 1
Topic Options
#142181 - 2005-06-22 06:02 PM Need help with small problem
astout Offline
Fresh Scripter

Registered: 2005-06-07
Posts: 16
Here is my new simplified script. It seems to work pretty decent, but it won't do the EXIT command at the end to close the command prompt. Is there a carriage return I need to add in?

;region Script Settings
;
;NEWANDY.KIX
;%TEMP%
;\\Kc-exc1\netlogon
;
;True
;
;True
;
;False
;True
;True
;False
;
;
;True
;
;
;1.0.0.1
;
;
;
;
;

;

;
;endregion

;**** Created with KiXscripts Editor | http://KiXscripts.com ****
;**** Last Modified on 11/02/2002 at 15:22:54 by willn ****

CLS
$section=1 ;Section 1
Color c+/n
Box (9,29,15,46,single)

Color r+/n
At (10,30) "Welcome to the,"
At (12,30) @domain
At (12,39) "domain"
At (14,30) @domain
Sleep 2

Small
Color b+/n
Box (0,0,24,79,GRID) ; ''background grid''
Color b/n
Box (8,21,18,61,Å) ; ''shadow'' of the box
Color g+/n
Box (7,20,17,60,FULL)

SetTime "\\fs1"

Color w+/n
At ( 9,25) "Userid : " ; display some text strings
At (10,25) "Full name : "
At (11,25) "Privilege : "
At (12,25) "Workstation : "
At (13,25) "Domain : "
At (14,25) "Logon Server : "
At (15,25) "Current Time : "
At (16,25) "Call ext. 227 with any problems!"
Color y+/n
At ( 9,40) @userid ; ...and some macro''s
At (10,40) @fullname
At (11,40) @priv
At (12,40) @wksta
At (13,40) @domain
At (14,40) @lserver
At (15,40) @time
Sleep 1

:set_vars
$section=$section+1 ; Section 2
Use "*" /delete
$j="\\djvkir1app2\microst"
$p="\\djvkir1app2\projects"
$u="\\djvkir1app2\@userid"

CLS
At (12,30) "Mapping Drives"
Use g: /delete
Use i: /delete
Use s: /delete

Use I: "\\kc-dc01\%username%" /persistent
Use S: "\\kc-dc01\swaps" /persistent
Use G: "\\fs\scans" /persistent
If @error<>0 Call @lserver + "\netlogon\fail.kix" EndIf

omain_Admin
$section=$section+1 ; Section 3
If InGroup ("Domain Admins")
CLS
At (13,30) "Mapping Additional Drives"
Use p: /delete
Use x: "\\fs1\it department" /persistent

If @error<>0 Call @lserver + "\netlogon\fail.kix" EndIf
EndIf

If InGroup ("ENG")
CLS
At (13,30) "Mapping Additional Drives"
Use T: "\\FS1\DFSROOT\ENG" /persistent
If @error<>0 Call @lserver + "\netlogon\fail.kix" EndIf
EndIf

If InGroup ("FINANCE")
CLS
At (13,30) "Mapping Additional Drives"
Use s: "\\FS1\DFSROOT\FINANCE" /persistent
Use J: "\\fs1\users\%username%" /persistent
Use K: "\\FS1\DFSROOT\Finance Share" /persistent
If @error<>0 Call @lserver + "\netlogon\fail.kix" EndIf
EndIf

If InGroup ("FNFORCST")
CLS
At (13,30) "Mapping Additional Drives"
Use L: "\\FS1\DFSROOT\FNFORCST" /persistent

If InGroup ("K-PAC")
CLS
At (13,30) "Mapping Additional Drives"
Use O: "\\FS1\DFSROOT\K-PAC" /persistent

If InGroup ("OPCOMM")
CLS
At (13,30) "Mapping Additional Drives"
Use N: "\\FS1\DFSROOT\OPCOMM" /persistent

If InGroup ("S&OP")
CLS
At (13,30) "Mapping Additional Drives"
Use M: "\\FS1\DFSROOT\S&OP" /persistent

If InGroup ("WKLYORD")
CLS
At (13,30) "Mapping Additional Drives"
Use L: "\\FS1\DFSROOT\WKLYORD" /persistent

:Securing_Station
$section=$section+1 ; Section 12
CLS
At (10,24) "Checking Screen saver. Please Wait"
$act=ReadValue("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaveActive")
$sec=ReadValue("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaverIsSecure")
If $act=1 And $sec=1
Goto Dontwrite
Else
Goto Write
EndIf
If @error<>0 Call @lserver + "\netlogon\fail.kix" EndIf


:Write
$section=$section+1 ; Section 13

WriteValue("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaveActive","1","REG_SZ")
WriteValue("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaverIsSecure","1","REG_SZ")
WriteValue("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaveTimeOut","900","REG_SZ")
WriteValue("HKEY_CURRENT_USER\Control Panel\Desktop","SCRNSAVE.EXE","c:\winnt\system32\SSPIPES.SCR","REG_SZ")
WriteValue("HKEY_CURRENT_USER\Control Panel\Screen Saver.3DPipes","JointType","2","REG_SZ")
If @ERROR = 0 CLS
At (10,24) "Screen Saver updated"
Else
If @error<>0 Call @lserver + "\netlogon\fail.kix" EndIf
EndIf
Goto IE_Start_Page


ontwrite
$section=$section+1 ; Section 14
CLS
At (10,24) "Screen Saver Already Set"
Sleep 1

:IE_Start_Page
$section=$section+1 ; Section 15
$home=ReadValue("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main","Start Page")
If $home<>"http://www.google.com"
Goto Set_Home_Page
Else
Goto end
EndIf

:Set_Home_Page
$section=$section+1 ; Section 16
If InGroup ("Domain Admins")
Goto END
Else
WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main","Start Page","http://www.google.com","REG_SZ")
EndIf
If @error<>0 Call @lserver + "\netlogon\fail.kix" EndIf


:END

Exit

Top
#142182 - 2005-06-22 06:06 PM Re: Need help with small problem
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
astout, could you take the time of few seconds and add code tags around your script?
it's awfull trying to read it as normal text.

thanks.
_________________________
!

download KiXnet

Top
#142183 - 2005-06-22 06:58 PM Re: Need help with small problem
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Look to see if KiX32.exe or WKiX32.exe is still in memory or not. THat is What EXIT will exit, not a DOS box. You need to look elsewhere for why you would have a lingering DOS box.

You should also rewrite the code to not use GOTOs.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#142184 - 2005-06-22 07:16 PM Re: Need help with small problem
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
and finally use code tags, which has been pointed to you in previous posts too, iirc...
_________________________
!

download KiXnet

Top
#142185 - 2005-06-23 05:24 AM Re: Need help with small problem
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Try adding a
Code:
CLS
EXIT 0


to the calling batch file as there's a documented Windows 9x problem with not closing the login batch file window correctly.
Of course, only applies to Windows 9x when calling KiXtart via batch file during a login process.
_________________________
There are two types of vessels, submarines and targets.

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 867 anonymous users online.
Newest Members
JimDunn, fgarcia, Viginette, ManuvdWielNL, Sir_Barrington
17890 Registered Users

Generated in 0.051 seconds in which 0.024 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