|
|
|||||||
Hi..I'm new to this and I havnt got a server set up to test it (yet) Part of it is out of a book, some from here and I removed all the statements cos I want to put that into a file on its own.. Can anyone see anything wrong with this script..? If @dos >= "5.0" $hklms = 'HKEY_LOCAL_MACHINE\SOFTWARE' If 1 <> ReadValue($hklms+"\Microsoft\Windows NT\CurrentVersion\Winlogon", "RunLogonScriptSync") $ = WriteValue ($hklms+"\Microsoft\Windows NT\CurrentVersion\Winlogon", "RunLogonScriptSync", "1", "REG_DWORD") EndIf EndIf If @INWIN=1 GoTo SETVARNT Else GoTo SETVAR95 EndIf :SETVAR95 Shell "winSET.exe USERNAME=@USERID" Shell "winSET.exe ADDRESS=@ADDRESS" Shell "winSET.exe COMPUTER=@WKSTA" Shell "winSET.exe DOMAIN=@DOMAIN" Shell "winSET.exe COMMENT=@COMMENT" Shell "winSET.exe FULLNAME=@FULLNAME" Shell "winSET.exe HOMEDIR=@HOMEDIR" Shell "winSET.exe HOMESHR=@HOMESHR" Shell "winSET.exe LSERVER=@LSERVER" Shell "winSET.exe PRIV=@PRIV" GoTo STAGE2 :SETVARNT ;SET varibles on NT clients using SET command Set USERNAME="@USERID" SETM ADDRESS="@ADDRESS" SETM COMPUTER="@WKSTA" SETM DOMAIN="@DOMAIN" Set COMMENT="@COMMENT" Set FULLNAME="@FULLNAME" Set HOMEDIR="@HOMEDIR" Set HOMESHR="@HOMESHR" Set LSERVER="@LSERVER" Set PRIV="@PRIV" :STAGE2 ;synchronizing with timeserver SetTime \\S01 EndIf ;delete any previous drive mappings and check for errors Use "*" /DELETE EndIf ;MAP Drives By Group Membership ;Map common drives for Domain Users If InGroup ("Domain") = 1 Use S: \\S01\shared Use P: \\S01\programs Use H: @HOMESHR EndIf Call LOGSCREEN.SRC |
||||||||
|
|
|||||||
basically yes. as kixtart is forgiving about the quotes, it does not complaint about your use statements but according to syntax rules, all string constants should be in quotes. the var part also little confuses me. first, as far as I know, kix should nowadays work fine on win9x and thus the winset shouldn't be needed. there were some changes in 4.12 and 4.21 for that. so, you should make a script without the goto part and use global stuff instead. and finally, according to docs, correct syntax for set is: SET "variable=string" then, out of curiocity (is it pronounced like that?), I'd like to know which book you've been reading. thanks and cheers. |
||||||||
|
|
|||||||
Reading Windows server 2003 by Mark Minasi |
||||||||
|
|
|||||||
My guess is this is Chris G. Oh, and Welcome to the board. Anyways... Here is my input on this. It is more difficult to use the SetOption NoVarInStrings setting, but it will force you to make sure your script coding is written better. Code: Break On |
||||||||
|
|
|||||||
The GOTOs should be removed and the SET statements would belong into the appropriate IF-ELSE-ENDIF sections. RunLogonScriptSync can also be implemented on a per-user setting if the user is not admin but should be deployed via LPO/GPO. |
||||||||
|
|
|||||||
Hey Thanks for your help, I will go through the manual and hopefully piece it together. Now I have something I know is going to work, it's a little easier.. Question: What is this part of the script doing? Break On Dim $iRC $iRC=SetOption('Explicit','On') $iRC=SetOption('NoVarsInStrings','On') **The "Domain" I just put there instead of the real group name. I was planning to change it back.. |
||||||||
|
|
|||||||
Look at the setoption in the manual for further information. It basically sets directives for the KIX executable on how to read and parse the script. If you want further information on it please let us know. Also don't forget that ScriptLogic maintains a compiled help file of the KiXtart manual and I have a compiled help file on my site as well for other KiXtart information. SCRIPTLOGIC http://www.scriptlogic.com/kixtart/ HTML Help File 4.22 http://209.50.244.178/downloads/kix/kixtart422.chm KIXHELP KORG-FAQ http://www.kixhelp.com/ http://www.kixhelp.com/Downloads/KORG-FAQ.chm |
||||||||
|
|
|||||||
A few comments... sme of which have already been said. Your SetTime and WriteValue() requires additional rights. You should use the W32tm sevice to sync time and policies to RunLogonScriptSync. Why do you need to set all those environment vars? WinSet.exe is not needed for Wintendos if using the current version of KiX. You should include the /Persistent switch with: Use "*" /DELETE /Persistent The If InGroup() statements don't need the = 1 on the end. All the USE commands should have quotes around the paths. There are two ENDIFs that don't have corresponding IFs. The CALL should include a full path or @ScriptDir before the filename. Restructure your IF statements to avoid GOTOs. |