Page 2 of 2 <12
Topic Options
#199819 - 2010-09-12 01:43 PM Re: Write Registry Key based on Computername [Re: Allen]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
That was my fault - I missed it when I removed the others while converting the "00000001" parameters to 1. I ran the code through Sanity and it found no errors other than a bunch of undeclared vars:
 Code:
(ICWD001) - C:\Temp>kgen testfile

KGen v2.4 - Kixtart script UDF linker
(C) 2000-2010 - Glenn Barnas / Inno-Tech Consulting

Searching for available UDFs.........................
 206 UDFs located in 131 files.
No UDFs needed for this generation!
Generation of t.KIX is complete!

Pass 1 : 520
Pass 2.

Warning: Undeclared variable.
              Variable Name: $Title
                In function: Main
         Referenced on line: 20
         Implicit declaration as GLOBAL!

Warning: Undeclared variable.
              Variable Name: $Progress
                In function: Main
         Referenced on line: 45
         Implicit declaration as GLOBAL!

Warning: Undeclared variable.
              Variable Name: $AjustProgress
                In function: Main
         Referenced on line: 46
         Implicit declaration as GLOBAL!

Warning: Undeclared variable.
              Variable Name: $X
                In function: Main
         Referenced on line: 79
         Implicit declaration as GLOBAL!

Warning: Undeclared variable.
              Variable Name: $
                In function: Main
         Referenced on line: 282
         Implicit declaration as GLOBAL!
Pass 3 : 520
Pass 4..
Pass 5 : 519
 5 warnings generated, 520 lines processed.
Can't/Won't run this on our network, but I'd break it down into sections for further testing.

Glenn

PS - I edited the original script post above to break 3 long lines.
_________________________
Actually I am a Rocket Scientist! \:D

Top
#199821 - 2010-09-12 10:40 PM Re: Write Registry Key based on Computername [Re: JSP]
ChristopheM Offline
Hey THIS is FUN
*****

Registered: 2002-05-13
Posts: 309
Loc: STRASBOURG, France
Have a look at the attachment file.

All the configuration for mapping drive is in two ini files :
- one for users
- one for groups

for a new user, add a section [user-<userid>] and lines with format :
drive:=uncpath||user||password

(user and password are optional)

for a new group, add a new line in the groups section
then add a new section [group-<groupname>] and lines with same format than for user

i have not tested all the code because i'm not at the office.
i have just simulated some actions (InGroup, map and map /delete).


Attachments
logon.zip (406 downloads)
Description:


_________________________
Christophe

Top
#199926 - 2010-09-16 08:01 PM Re: Write Registry Key based on Computername [Re: Allen]
JSP Offline
Fresh Scripter

Registered: 2010-09-01
Posts: 12
Loc: Phoenix AZ
I'm using notepad as the editor. It seems the problem is with
 Code:
If LEFT(@WKSTA,7) = 'mtscapp'


should mtscapp be in quotes or apostrophes?

Top
#199930 - 2010-09-16 10:38 PM Re: Write Registry Key based on Computername [Re: JSP]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Doesn't matter - Kix is happy with either. I asked about the editor because sometimes an editor will replace the quotes with "typographic" quotes - usually Word, Outlook, or Wordpad are the culprits.

Just for sanity - Try: If InStr(@WKSTA, 'mtscapp') = 1
This will test for the string's presence starting at position 1.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#199942 - 2010-09-17 04:39 PM Re: Write Registry Key based on Computername [Re: Glenn Barnas]
JSP Offline
Fresh Scripter

Registered: 2010-09-01
Posts: 12
Loc: Phoenix AZ
I get the following results:

┌┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┐
├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼█ MultiTest/STG - Harbor Electronics Network Login █┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼█ █┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼█ Userid : █┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼█ Full name : █┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼█ Privilege : ADMIN █┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼█ Workstation : MTSCAPP01 █┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼█ Domain : STG █┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼█ Logon Server : \\STGDC01 █┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼█ IP Address : xxx. xx. xx. 47uccessfully.n completed s
The system cannot find the path specified. █┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
L:\>┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼█ █┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
├┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┼┤
└┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┘


Edited by JSP (2010-09-17 04:41 PM)

Top
#199948 - 2010-09-17 06:21 PM Re: Write Registry Key based on Computername [Re: JSP]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Try this - I've eliminated the Gosubs, which can cause some strange errors if they aren't properly balanced. I've also cleaned up the code a tad, breaking it into 5 distinct functions - Splash(), ClearDriveMaps(), MapUserDrives(), MapGroupDrives, and OtherStuff().

Keep in mind that this is NOT how I'd create a loginscript, but trying to troubleshoot code based on a 10-year old design was not worth it. First off, I'd never put hard-coded parameters into a login script. This script impacts every user in the organization, and a single typo can create havoc. Our commercial script has no internal logic.. in fact, it's compiled so our customers can't change it if they wanted to. Everything is handled via an external config file. Take a look at the user manual on our web page to get an idea of how external configuration works. With that kind of technology, we can install our script in a client infrastructure, configure the INI file and be operational quickly.. minutes in a site of simple to moderate complexity.

Make sure to disable debugging by setting $DEBUG = 0 in the variable definition area!!!

Glenn
 Code:
;**** Last Modified on 3/20/2009 at 8:56:00 AM by SuperJeffie ****
;************************************************************
;** Script:		Login Screen
;** Version:	2.1
;** Created:	April 17, 2001
;**
;** Author:		Keith Judy
;** E-mail:		xx@xxxxxx-xxxxxxx.com
;**
;** Purpose / Comments:
;**
;**		Show a splash page while the user is logging in.
;**
;**
;************************************************************

; Turn break off  (should be OFF for login script!)
Break Off


; Declare variables
;************************************************************
Dim $Rc					; catch & discard return code
Dim $Title				; splash page title

Global $PROGRESS			; progress bar position
Global $DEBUG				; Debug flag




; Initialize variables
;************************************************************
; Your institutions name goes here
$Title = "MultiTest/STG - Harbor Electronics Network Login"

$DEBUG = 1
$PROGRESS = 0





If $DEBUG Break On EndIf		; allow break if debugging

$Rc = SetASCII("on")			; Set output to ASCII


; MAIN
;************************************************************

Splash($Title)				; Show the splash screen

ClearDriveMaps()			; Unmap prior drive mappings I: through Z:

MapUserDrives()				; map drives by user

MapGroupDrives()			; map drives by group

OtherStuff()				; could use a better name for this :)

DrawProgress(100)			; complete the progress bar

At(23,70) @CRLF				; leave cursor at bottom of screen
Quit 0




;************************************************************
;** Script Functions
;************************************************************



; DrawProgress(#)
;************************************************************
; Extend the progress bar by an increment amount, up to a limit of 37 positions
;
Function DrawProgress($_Inc)

  Dim $_ProgBar
  Dim $_I

  ; Create a full progress bar using the desired character
  For $_I = 1 to 40
    $_ProgBar = $_ProgBar + Chr(219)
  Next
  

  $PROGRESS = $PROGRESS + $_Inc			; increment progress bar
  $PROGRESS = IIF($PROGRESS>37, 37, $PROGRESS)	; limit to 37 positions

  ; Diplay curent progress
  Color Y+/N
  At(20, 22) Left($_ProgBar, $PROGRESS)

  If $DEBUG Sleep 0.75 EndIf			; slow down during debugging

  Exit 0

EndFunction



; Splash()
;************************************************************
; Draw splash screen & populate with information
;
Function Splash($_Title)

  Cls

  ; Background grid
  Color B+/N
  Box (0, 0, 24, 79, GRID)			
	
  ; Title banner
  Color B/N
  Box (3, 3, 5, Len ($_Title + 8) + 5, Å) ; shadow
  Color G+/N
  Box (2, 2, 4, Len ($_Title + 8) + 4, FULL) ; box	
	
  ; Information box
  Color B/N
  Box (8, 21, 18, 61, Å) ; shadow
  Color G+/N
  Box (7, 20, 17, 60, FULL) ; box
		
  ; Draw the progress bar
  Color B/N
  Box (20, 21, 22, 61, Å) ; shadow
  Color G+/N
  Box (19, 20, 21, 60, FULL) ; box
	
  ; Center the title on the screen
  Color Y+/N
  At ( 3, 4) $_Title
	
  ; Display some text strings
  Color W+/N
  At( 9, 25) 'Userid       : ' @USERID
  At(10, 25) 'Full name    : ' @FULLNAME
  At(11, 25) 'Privilege    : ' @PRIV
  At(12, 25) 'Workstation  : ' @WKSTA
  At(13, 25) 'Domain       : ' @DOMAIN
  At(14, 25) 'Logon Server : ' @LSERVER
  At(15, 25) 'IP Address   : ' @IPADDRESS0
	
  Exit 0

EndFunction


; ClearDriveMaps()
;************************************************************
;
Function ClearDriveMaps()

  DrawProgress(4)

  If Not $DEBUG
    ; Clear Mapped volumes/drives if not debugging
    Use i: /delete
    Use j: /delete
    Use k: /delete
    Use l: /delete
    Use n: /delete
    Use o: /delete
    Use p: /delete
    Use q: /delete
    Use r: /delete
    Use s: /delete
    Use t: /delete
    Use v: /delete
    Use w: /delete
    Use x: /delete
    Use z: /delete
  EndIf

  DrawProgress(4)

  Exit 0

EndFunction


Function MapUserDrives()

  If @USERID = 'strawboss'
    Use m: '\\stgazfile01\users'
    Use n: '\\stgazts01\IT'
    Use o: '\\stgscfile02\IT'
  EndIf

  If @USERID = 'pphasouk'
    Use h: '\\Ectazdata\DesignJobs'
    Use m: '\\cam01az\Genesis'
    Use n: '\\stgazfile01\Cam'
    Use s: '\\stgazfile01\Common'
  EndIf

  If @USERID = 'tbleakley'
    Use w: '\\stgscfile02\18.ASSEMBLY'
    Use s: '\\hei02file01\Common'
  EndIf

  If @USERID = 'KronosAdmin'
     Use o: '\\hei01file02\kronos_backup'
  EndIf

  If @USERID = 'djohnson'
    Use u: '\\hei01file01\users\djohnson'
    Use x: /delete
  EndIf

  DrawProgress(4)

; S: drives for Scanners
  If @USERID = 'tmcnulty'
    Use s: '\\hei01file01\scans\tim'
    Use t: '\\stgscts01\ftp\tim'
  EndIf

  If @USERID = 'kpau'
    Use s: '\\hei01file01\scans\Katrina'
  EndIf

  If @USERID = 'lmendoza'
    Use s: '\\hei01file01\scans\lupe'
  EndIf

  If @USERID = 'lcabael'
    Use l: '\\hei01file01\scans\larissa'
  EndIf

  If @USERID = 'gbadhesa'
    Use s: '\\hei01file01\scans\Intel-CS'
    Use t: '\\hei02ftp01\ftp' /user:ftpuser /Password:'password'
  EndIf

  If @USERID = 'majohnson'
    Use s: '\\hei01file01\scans\Intel-CS'
  EndIf

  If @USERID = 'mdias'
    Use s: '\\hei01file01\scans\Intel-CS'
  EndIf


  If @USERID = 'aterrell'
    Use s: '\\hei01file01\scans\april'
  EndIf

  If @USERID = 'carteaga'
    Use s: '\\hei01file01\scans\cynthiaa'
  EndIf

  If @USERID = 'edh'
    Use q: '\\hei01file01\scans\edh'
  EndIf

;End of S: Drives

  DrawProgress(4)

  If @USERID = 'testroom'
    Use n: '\\hei01file03\atg_jobs'
    Use k: '\\hei01file03\cam\atg_fault files'
  EndIf

  If @USERID = 'ectacct'
    Use l: '\\w01acct02\d'
  EndIf

  If @USERID = 'routing'
    Use s: /delete
    Use s: '\\10.0.0.24\genesis_archive'
  EndIf


  If @USERID = 'drillterm'
    Use s: /delete
    Use s: '\\10.0.0.24\genesis_archive'
  EndIf

  If @USERID = 'conceptdrill'
    Use f: /delete
    Use f: '\\ultraser\drillfiles'
  EndIf

  If @USERID = 'hzelic'
    Use k: /delete
    Use k: '\\fls-tester\e$'
    Use l: /delete
    Use l: '\\fls-tester\c$'
  EndIf

  If @USERID = 'agreen'
    Use t: '\\hei02ftp01\ftp' /user:ftpuser /Password:'password'
  EndIf


  If @USERID = 'qcfinal'
    Use h: '\\ultraser\drillfiles'
  EndIf

  If @USERID = 'epascual'
    Use s: '\\ectfs\acct\accounting'
  EndIf

  If @USERID = 'bselfridge'
    Use w: '\\stgscfile02\company\18.Assembly'
  EndIf

  If @USERID = 'jferrell'
    Use m: '\\stgscfile02\company\18.Assembly'
  EndIf

  If @USERID = 'eurena'
    Use z: '\\10.0.0.221\harborcam' /user:harborcam /Password:'password'
  EndIf

  If @USERID = 'notesadmin'
    Use f: '\\notes3\notesadmins'
  EndIf

  If @USERID = 'lcabael'
    Use q: '\\stgscts01\ftp'
  EndIf

  If @USERID = 'jferrell'
    Use l: /delete
    Use w: /delete
    Use l: '\\10.0.0.24\frontline'
    Use w: '\\stgscfile02\company\18.Assembly'
  EndIf

  DrawProgress(4)

  Exit 0

EndFunction
	

Function MapGroupDrives()

 If Not $DEBUG

  ; Map common network volumes/drives
  Use p: '\\hei01file02\company'

  ; Map Group network volumes/drives
  If InGroup('Cam Users')
    Use g: '\\ucam2k\plotjobs'
    Use h: '\\ultraser\drillfiles'
    Use i: '\\hei01file03\atg_Jobs'
    Use s: '\\10.0.0.24\genesis_archive'
    Use v: '\\hei01file04\frontline_valor'
    Use w: '\\10.0.0.24\frontline'
    Use x: '\\stgcc01\comm'
    Use z: '\\10.0.0.221\harborcam' /user:harborcam /Password:'password'
  EndIf


  If InGroup('HR-D')
    Use q: '\\w01acct02\D'
  EndIf


  If InGroup('ShippingGroup')
    Use s: '\\hei01file01\scans\shipping'
    Use q: '\\hei01dmz\FormFactorQuality'
  EndIf


  If InGroup('valor')
    Use s: /delete
    Use s: '\\10.0.0.24\genesis_archive'
  EndIf


  If InGroup('Genesis')
    Use f: /delete
    Use t: '\\valor\genesis' /user:starsys /Password:'password'
  EndIf

  If InGroup('Genesis Job')
    Use s: /delete
    Use s: '\\10.0.0.24\genesis_archive'
  EndIf

  If InGroup('ELD Group')
    Use j: '\\hei02ftp01\ftp' /user:ftpuser /Password:'password'
  EndIf

  If InGroup('AOI') 
    Use s: '\\hei01file02\aoi'
  EndIf

  If InGroup('QA Group - QC') 
    Use q: '\\hei01file01\quality'
  EndIf

  If InGroup('QA Group - QA') 
    Use t: '\\stgcc01\gentmp'
  EndIf

  If InGroup('Doc_Control')
    Use s: '\\hei01file01\Quality'
  EndIf

  If InGroup('CAMFTP')
    Use q: '\\stgscts01\ftp'
  EndIf

  If InGroup('DesignGroup')
    Use r: '\\hei02file01\design'
    Use t: '\\hei02ftp01\ftp' /user:ftpuser /Password:'password'
    Use s: '\\hei02file01\SCD_Designs'
  EndIf

  If InGroup('HarborDesign')
    Use n: '\\stgscfile02\SCD_Designs'
  EndIf

  If InGroup('ELD Group')
    Use l: '\\hei01file02\PenangDesign'
    Use r: '\\hei02file01\design'
    Use t: '\\hei02ftp01\ftp' /user:ftpuser /Password:'password'
  EndIf

  If InGroup('HEIPenang')
    Use p: /delete
    Use p: '\\hei03exch02\PenangDesign'
    Use l: '\\hei01file02\PenangDesign'
    Use t: '\\hei02ftp01\ftp' /user:ftpuser /Password:'password'
  EndIf

  If InGroup('Sales STGSC')
    Use r: '\\hei01file02\sales'
  EndIf

  If InGroup('kronos')
    Use m: '\\hei01kronos\kronos1$'
    Use n: '\\hei01kronos\kronos2$'
    Use o: '\\hei01kronos\wfc'
  EndIf

  If InGroup('Domain Admins')
    Use r: '\\stgscfile02\IT'
  EndIf

  If InGroup('MIS')
    Use r: '\\stgscfile02\IT'
  EndIf

  If InGroup('WET')
    Use w: '\\hei01cam01\frontline'
  EndIf

  If InGroup('STGSG-FTP')
    Use z: '\\stgscts01\FTP\STGSG'
  EndIf

  If InGroup('AssemblyDrive')
    Use w: '\\stgscfile02\company\18.Assembly'
  EndIf

  If InGroup('MultiTest-CS')
    Use g: '\\stgscts01\ftp\mt-germany'
  EndIf

  If InGroup('CustomerService') ;Tempe CS S: Drive
    Use s: '\\stgazfile01\common\Customer Service'
  EndIf

 EndIf ; debug

  DrawProgress(4)

  Exit 0

EndFunction

Function OtherStuff()

  Dim $_Rc

  If InGroup('EnableDrives')
    $_Rc = WriteValue ('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR', 'Start', 3, 'Reg_Dword')
  EndIf

  If InGroup('STGAZ Design Center Homepage')
    $_Rc = WriteValue ('HKEY_CURRENT_USER\Software\Microhard\Internet Explorer\Main', 'Start Page', 'http://estg/design/default.aspx', 'Reg_SZ')
    $_Rc = WriteValue ('HKEY_CURRENT_USER\Software\Microhard\Internet Explorer\Main', 'Secondary Start Pages', 'http://estgaz/Reports/Pages/Report.aspx?ItemPath=/eSTGSC/Design/TempeDesignSchedule', 'Reg_Multi_SZ')
  EndIf


  DrawProgress(4)

  If LEFT(@WKSTA, 7) = 'mtscapp'
    If InGroup('AltLNDrive')
      'Writing NotesIniPath "A" :'
      $_Rc = WriteValue('HKEY_CURRENT_USER\Software\Lotus\Notes\8.0', 'NotesIniPath', 'G:\Lotus\Notes\Data\notes.ini', 'Reg_SZ')
      @SERROR ?
      'Writing NeedCommonFiles "A": '
      $_Rc = WriteValue('HKEY_CURRENT_USER\Software\Lotus\Notes\8.0', 'NeedCommonFiles', 1, 'Reg_DWord')
      @SERROR ?
    Else
      'Writing NotesIniPath "B": '
      $_Rc = WriteValue('HKEY_CURRENT_USER\Software\Lotus\Notes\8.0', 'NotesIniPath', 'U:\Lotus\Notes\Data\notes.ini', 'Reg_SZ')
      @SERROR ?
      'Writing NeedCommonFiles "B": '
      $_Rc = WriteValue('HKEY_CURRENT_USER\Software\Lotus\Notes\8.0', 'NeedCommonFiles', 1, 'Reg_DWord')
      @SERROR ?
    EndIf
  EndIf

  DrawProgress(4)

  Exit 0

EndFunction
_________________________
Actually I am a Rocket Scientist! \:D

Top
#199951 - 2010-09-17 08:31 PM Re: Write Registry Key based on Computername [Re: Glenn Barnas]
JSP Offline
Fresh Scripter

Registered: 2010-09-01
Posts: 12
Loc: Phoenix AZ
Copied and ran your script, but got an error.


L:\>echo off
Current time at \\STGDC01 is 9/17/2010 11:28 AM

The command completed successfully.

Script error : unknown command !.
Splash($Title) ; Show the splash screen


L:\>

Top
#199952 - 2010-09-17 08:52 PM Re: Write Registry Key based on Computername [Re: JSP]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
 Code:
 Box (3, 3, 5, Len ($_Title + 8) + 5, Å) ; shadow


something just not right there. that most likely what errored it for you JSP \:\)
_________________________
!

download KiXnet

Top
#199959 - 2010-09-18 10:08 PM Re: Write Registry Key based on Computername [Re: JSP]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Ditch the bat file - also 10-year old procedures.. You don't really have Wintendo systems (Win9x), do you??? Same with the time sync - unneeded in an AD environment.

I just copied this, created LS.KIX and pasted the content into the file. Saved it and ran Kix32 LS.KIX and it worked flawlessly.

I'm running Kix 4.61, but also tested it with Kix 4.53, where it ran without error. Those are the only versions I'd consider using for login scripts.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#199960 - 2010-09-18 10:12 PM Re: Write Registry Key based on Computername [Re: Lonkero]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Nope - that's an optional character used in place of the 4 standard types that generates a shadow effect.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#200003 - 2010-09-21 09:48 PM Re: Write Registry Key based on Computername [Re: Glenn Barnas]
JSP Offline
Fresh Scripter

Registered: 2010-09-01
Posts: 12
Loc: Phoenix AZ
Unfortunately we still have a few Win9x machines, they run some manufacturing equipment, are from foreign vendors who either don't have software that will run on newer OS or the cost is prohibitive.

We are using Kixtart V3.63, and it's not really feasible to upgrade it right now.

Top
#200023 - 2010-09-22 09:25 PM Re: Write Registry Key based on Computername [Re: Glenn Barnas]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
btw glenn, I bet I could rewrite your "general" "non-editable" code into lonkenized couple line specific version ;\)
_________________________
!

download KiXnet

Top
Page 2 of 2 <12


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 382 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.065 seconds in which 0.026 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org