Page 1 of 2 12>
Topic Options
#199716 - 2010-09-01 06:08 PM Write Registry Key based on Computername
JSP Offline
Fresh Scripter

Registered: 2010-09-01
Posts: 12
Loc: Phoenix AZ
Hi All-

My company just switched to Lotus Notes (I know, pitty me), many of our users work off a Terminal Server, in order for notes to work a change needs to be made in HKCU, I'd like to do that via the login script but I only need it to run if they are logging into the Terminal Servers. Is there a way to execute the write command based on computername? Any help would be appreciated, here are the the registry entries.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Lotus\Notes\8.0]
"NotesIniPath"="U:\\Lotus\\Notes\\Data\\notes.ini"
"NeedCommonFiles"=dword:00000001


Edited by JSP (2010-09-01 06:12 PM)

Top
#199717 - 2010-09-01 06:36 PM Re: Write Registry Key based on Computername [Re: JSP]
eriqjaffe Offline
Hey THIS is FUN

Registered: 2004-06-24
Posts: 214
Loc: Arlington Heights, IL USA
There are a couple of ways, ultimately.

Depending on the naming structure of your Terminal Servers, you can use INSTR or LEFT:

 Code:
if INSTR(@WKSTA,"Terminal") = 1
     ; do things

 Code:
if LEFT(@WKSTA,5) = "Termi"
     ; do things

INSTR will just look for the string - "Terminal Server 1" and "Bills Terminal Illness" will both return positives, and that may not be what you want.

LEFT will only return positive if the LEFT x characters match - "Terminal Server 1" would be positive, "Bills Terminal Illness" wouldn't.

You could also use the @TSSESSION macro to determine if it's a Terminal Services session:

 Code:
IF @TSSESSION = 1
     ; do things

Top
#199718 - 2010-09-01 08:04 PM Re: Write Registry Key based on Computername [Re: eriqjaffe]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4642
Loc: The Netherlands
Hard coding (part of) the server name(s) is something that I would not recommend because when names are change dor servers are added you need to modify the script manually. Could be a PITA.
If it is just MS TS then @TSSession would do the trick. If you have MS TS servers and ICA (Citrix) servers and need to do different things for either one of them then the SessionType UDF will work for you.

UDF Library SessionType() - Gets the session type for the current user
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#199794 - 2010-09-09 07:34 PM Re: Write Registry Key based on Computername [Re: Mart]
JSP Offline
Fresh Scripter

Registered: 2010-09-01
Posts: 12
Loc: Phoenix AZ
Thanks! That's just what I need.
Top
#199795 - 2010-09-09 10:21 PM Re: Write Registry Key based on Computername [Re: JSP]
JSP Offline
Fresh Scripter

Registered: 2010-09-01
Posts: 12
Loc: Phoenix AZ
Well I tried my script, but it's not working, maybe i'm missing something.

 Code:
If LEFT(@WKSTA,7) = "MTSCApp"
	If InGroup ("AltLNDrive")=1
		RegWrite("HKEY_CURRENT_USER\Software\Lotus\Notes\8.0", "NotesIniPath", "G:\Lotus\Notes\Data\notes.ini", "Reg_SZ")
 		RegWrite("HKEY_CURRENT_USER\Software\Lotus\Notes\8.0", "NeedCommonFiles", "00000001", "Reg_DWord")
	Else
		RegWrite("HKEY_CURRENT_USER\Software\Lotus\Notes\8.0", "NotesIniPath", "U:\Lotus\Notes\Data\notes.ini", "Reg_SZ")
 		RegWrite("HKEY_CURRENT_USER\Software\Lotus\Notes\8.0", "NeedCommonFiles", "00000001", "Reg_DWord")
		
	EndIf
EndIf


Edited by Mart (2010-09-10 08:58 AM)
Edit Reason: Added code tags.

Top
#199797 - 2010-09-09 10:33 PM Re: Write Registry Key based on Computername [Re: JSP]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4447
Loc: USA
Regwrite? Do you mean WriteValue?
Top
#199798 - 2010-09-09 10:48 PM Re: Write Registry Key based on Computername [Re: Allen]
JSP Offline
Fresh Scripter

Registered: 2010-09-01
Posts: 12
Loc: Phoenix AZ
I've tried both, neither work, something pops up in red on the splash screen when the script runs, but it goes by too fast to read. I think the problem is with the LEFT(@wksta) part, i get the red error regardless of the server i'm logging into.
Top
#199801 - 2010-09-10 08:57 AM Re: Write Registry Key based on Computername [Re: JSP]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4642
Loc: The Netherlands
What happens when you run the script in debug mode (kix32.exe yourscript.kix /d)? By default Kix does not show errors in red. With the debug mode you might be able to find out what line is causing this.

RegWrite does not exist in Kix so that is not going to work. It is called WriteValue in Kix.


Edited by Mart (2010-09-10 09:01 AM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#199802 - 2010-09-10 09:13 AM Re: Write Registry Key based on Computername [Re: JSP]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4945
Loc: Leatherhead, Surrey, UK
It could be a problem with the script, or it could be a problem with the way that you are running it.

Basics first:
  1. Add some comment code to track the script processing.
  2. Log on to the MTSCApp* server using terminal services and open a command (DOS) prompt.
  3. Run the script from the command prompt using the same method and path as you would during logon.


If there is an error in the script or in the way that you are calling it then it will remain on screen and you will see it. You will also see the progress comments, so you will know that something is happening.

Here is an example:
 Code:
$sLNRegKey="HKEY_CURRENT_USER\Software\Lotus\Notes\8.0"
If InStr(@WKSTA,"MTSCApp")=1 AND @TSSESSION
	"This is a terminal server session on MTSCApp*"+@CRLF
	If InGroup("AltLNDrive")
		"This user is in group AltLNDrive"+@CRLF
		$=WriteValue($sLNRegKey, "NotesIniPath", "G:\Lotus\Notes\Data\notes.ini", "Reg_SZ")
		$=WriteValue($sLNRegKey, "NeedCommonFiles", 1, "Reg_DWord")
	Else
		"This user is not in group AltLNDrive"+@CRLF
		$=WriteValue($sLNRegKey, "NotesIniPath", "U:\Lotus\Notes\Data\notes.ini", "Reg_SZ")
		$=WriteValue($sLNRegKey, "NeedCommonFiles", 1, "Reg_DWord")
	EndIf
Else
	"This is not a terminal server session on MTSCApp*"+@CRLF
EndIf 

Exit 0

Top
#199803 - 2010-09-10 12:52 PM Re: Write Registry Key based on Computername [Re: Richard H.]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4285
Loc: New Jersey
Take note of Richard's use of WriteValue, particularly when using REG_DWORD. A DWORD is a double-word number, and you were passing a string with many leading zeros. While it would not cause a script error, it's possible that it would not write the correct value to the registry.

Always, (no - ALWAYS!!!) run your scripts from a command line during testing, NEVER from the GUI/Explorer/Drag-n-Drop as you will miss all of the useful error and diag messages.

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

Top
#199808 - 2010-09-10 07:20 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 ran the script from the command prompt (thanks for that little tip!), I get this error message when it gets to the new stuff I added.

Script error : xpression.
If LEFT(@WKSTA,7) = "mtscapp"
The system cannot find the path specified.

This is the new code I added:
 Code:
If LEFT(@WKSTA,7) = "mtscapp"
	If InGroup ("AltLNDrive")=1
		$=WriteValue("HKEY_CURRENT_USER\Software\Lotus\Notes\8.0", "NotesIniPath", "G:\Lotus\Notes\Data\notes.ini", "Reg_SZ")
 		$=WriteValue("HKEY_CURRENT_USER\Software\Lotus\Notes\8.0", "NeedCommonFiles", "00000001", "Reg_DWord")
	Else
		$=WriteValue("HKEY_CURRENT_USER\Software\Lotus\Notes\8.0", "NotesIniPath", "U:\Lotus\Notes\Data\notes.ini", "Reg_SZ")
 		$=WriteValue("HKEY_CURRENT_USER\Software\Lotus\Notes\8.0", "NeedCommonFiles", "00000001", "Reg_DWord")
		
	EndIf
EndIf


Edited by Glenn Barnas (2010-09-10 07:25 PM)
Edit Reason: added code tags

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

Registered: 2003-01-28
Posts: 4285
Loc: New Jersey
Try this to further isolate the error:
 Code:
If LEFT(@WKSTA,7) = 'mtscapp'
  If InGroup ('AltLNDrive')
'Writing NotesIniPath "A" :'
    $=WriteValue('HKEY_CURRENT_USER\Software\Lotus\Notes\8.0', 'NotesIniPath', 'G:\Lotus\Notes\Data\notes.ini', 'Reg_SZ')
@SERROR ?
'Writing NeedCommonFiles "A": '
    $=WriteValue('HKEY_CURRENT_USER\Software\Lotus\Notes\8.0', 'NeedCommonFiles', 1, 'Reg_DWord')
@SERROR ?
  Else
'Writing NotesIniPath "B": '
    $=WriteValue('HKEY_CURRENT_USER\Software\Lotus\Notes\8.0', 'NotesIniPath', 'U:\Lotus\Notes\Data\notes.ini', 'Reg_SZ')
@SERROR ?
'Writing NeedCommonFiles "B": '
    $=WriteValue('HKEY_CURRENT_USER\Software\Lotus\Notes\8.0', 'NeedCommonFiles', 1, 'Reg_DWord')
@SERROR ?
  EndIf
EndIf
Also, despite what you see in RegEdit, the value you need to write is 1, not "00000001"!

The debug messages will identify the step and grouping (A or B) and the result of each function. I don't indent temporary debug messages to keep them easy to find/remove later.

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

Top
#199810 - 2010-09-10 07:55 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 same result.

Script error : xpression.
If LEFT(@WKSTA,7) = "mtscapp"
The system cannot find the path specified.

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

I added @SERROR after the 1st line and got this result:

Script error : xpression.
If LEFT(@WKSTA,7) = "mtscapp"

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


Edited by Mart (2010-09-13 09:16 AM)
Edit Reason: Please use code tags when posting code.

Top
#199811 - 2010-09-10 08:36 PM Re: Write Registry Key based on Computername [Re: JSP]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4447
Loc: USA
When you are at the command line... what are you typing to start your script?

Also, add the following line to the very top of your script and tell us your result.

? @kix

Top
#199812 - 2010-09-10 10:05 PM Re: Write Registry Key based on Computername [Re: Allen]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4285
Loc: New Jersey
What are you using to edit your script source?

G-
_________________________
Actually I am a Rocket Scientist! \:D

Top
#199813 - 2010-09-10 10:18 PM Re: Write Registry Key based on Computername [Re: Allen]
JSP Offline
Fresh Scripter

Registered: 2010-09-01
Posts: 12
Loc: Phoenix AZ
The kixtart script is called from a batch file (This is the batchfile Active Directory calls when the user logs in), here's the batch file code:

 Code:
@echo ***********************************************************
@echo *                 Everett Charles Technologies            *
@echo *                  Client/Server Logon Screen             *
@echo ***********************************************************


:start
cls
echo off
net time /domain:stg /set /yes
rem echo The network is performing an inventory on your system...
rem echo Please wait...
wscript %0\..\iecache-1mb.vbs
rem \\hei01mis01\Inventory$\ocsinventory.exe

:oscheck
if "%OS%"=="Windows_NT" goto Winnt
endif
rem %0\..\vplogon.bat

:Win95
net use i: \\hei01file02\sales
net use j: \\hei01file02\datahabitat
net use l: \\hei01file02\cam
net use n: \\hei01mis01\mis
net use o: \\hei01pdc01\ftp
net use p: \\hei01file02\company
net use q: \\hei01file02\design
net use s: \\hei01file02\aoi
net use u: /home
net use v: \\hei01file03\cam
goto usercheck

:winnt
%0\..\Kix32.exe kixtart.kix

goto end

:usercheck
if "%username%"=="topdog" goto administrator endif
goto end

:administrator
net use /delete n: /yes
net use n: \\hei01file02\mis /persistent:no
net use /delete t: /yes
goto end

:end


This is the whole Kixtart Script:

 Code:
 ;**** Created with KiXscripts Editor | http://KiXscripts.com ****
;**** 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.
;**
;**
;************************************************************
; Your institutions name goes here
$Title = "MultiTest/STG - Harbor Electronics Network Login"

;************************************************************
;** Script Start
;**

; Turn break on

Break On 
SetTime "*"
; Start of Script
:MAIN
	
	; Set output to ASCII
	Dim $PreviousASCIIState
	$PreviousASCIIState = SetASCII ("on")	
	
	; Clear the screen
	CLS
 
	; Show the splash screen
	Gosub SPLASH_SCREEN
	
	; Progress meter init 
	;	NOTE: A Full bar is 34
	$Progress 		= 0	
	$AjustProgress	= 0
	
	;
	; Do something...
	;
	
	Sleep 1
	
	; Update progress bar
	$AjustProgress = 10  ; add 10 blocks
	Gosub DRAW_PROGRESS
	
	;
	; Do something else...
	;      
	
	Sleep 1
	
	; Update progress bar	
	$AjustProgress = 10  ; add 10 more blocks
	Gosub DRAW_PROGRESS
		
	;
	; Do something else, again...
	;
	
	Sleep 1
	
	; Update progress bar
	$AjustProgress = 14  ; were done
	Gosub DRAW_PROGRESS
	
	; Reset the output mode
	$X = SetASCII ($PreviousASCIIState)
	
	; Clear the screen again
	CLS	
Cookie1		
Exit 
; Quit

;************************************************************
;** Script Subroutines ( GOSUBs )
;**

; Draw screen information
:SPLASH_SCREEN

	; 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       : "
    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) "IP Address   : "
	
	; ...and some macro's
	Color Y+/N
	At ( 9, 40) @USERID
	At (10, 40) @FULLNAME
	At (11, 40) @PRIV
	At (12, 40) @WKSTA
	At (13, 40) @DOMAIN
	At (14, 40) @LSERVER
	At (15, 40) @IPADDRESS0
Sleep 1

:mapping
; Clear Mapped volumes/drives
Use i: /delete
;DelKey("hkey_current_user\network\persistent\i")
Use j: /delete
;DelKey("hkey_current_user\network\persistent\j")
Use k: /delete
;DelKey("hkey_current_user\network\persistent\k")
Use l: /delete
;DelKey("hkey_current_user\network\persistent\l")
Use n: /delete
;DelKey("hkey_current_user\network\persistent\n")
Use o: /delete
;DelKey("hkey_current_user\network\persistent\o")
Use p: /delete
;DelKey("hkey_current_user\network\persistent\p")
Use q: /delete
;DelKey("hkey_current_user\network\persistent\q")
Use r: /delete
;DelKey("hkey_current_user\network\persistent\r")
Use s: /delete
;DelKey("hkey_current_user\network\persistent\s")
Use t: /delete
;DelKey("hkey_current_user\network\persistent\t")
Use v: /delete
;DelKey("hkey_current_user\network\persistent\v")
Use w: /delete
;DelKey("hkey_current_user\network\persistent\w")
Use x: /delete
;DelKey("hkey_current_user\network\persistent\x")  
Use z: /delete
;DelKey("hkey_current_user\network\persistent\z")    
                                 
; Map common network volumes/drives
Use p: "\\hei01file02\company"

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


; 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

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


	


; Map Group network volumes/drives
If InGroup ("Cam Users")=1 
	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")=1
	Use q: "\\w01acct02\D"

		EndIf


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


If InGroup ("valor")=1 
Use s: /delete
	Use s: "\\10.0.0.24\genesis_archive"

		EndIf


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

If InGroup ("Genesis Job")=1
	Use s: /delete
	Use s: "\\10.0.0.24\genesis_archive"

		EndIf

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

If InGroup ("AOI")=1 
	Use s: "\\hei01file02\aoi"
		EndIf

If InGroup ("QA Group - QC")=1 
	Use q: "\\hei01file01\quality"
		EndIf

If InGroup ("QA Group - QA")=1 
	Use t: "\\stgcc01\gentmp"
		EndIf

If InGroup ("Doc_Control")=1
	Use s: "\\hei01file01\Quality"
		EndIf

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

If InGroup ("CAMFTP")=1
	Use q: "\\stgscts01\ftp"
		EndIf

If InGroup ("DesignGroup")=1

	Use r: "\\hei02file01\design"
	Use t: "\\hei02ftp01\ftp" /user:ftpuser /Password:"password"
	Use s: "\\hei02file01\SCD_Designs"
		EndIf

If InGroup ("HarborDesign")=1

	Use n: "\\stgscfile02\SCD_Designs"
		EndIf

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

		EndIf

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

		EndIf

If InGroup ("Sales STGSC")=1
	Use r: "\\hei01file02\sales"

		EndIf

If InGroup ("kronos")=1
	Use m: "\\hei01kronos\kronos1$"
	Use n: "\\hei01kronos\kronos2$"
	Use o: "\\hei01kronos\wfc"

		EndIf

If InGroup ("Domain Admins")=1
	Use r: "\\stgscfile02\IT"
		EndIf

If InGroup ("MIS")=1
	Use r: "\\stgscfile02\IT"
		EndIf

If InGroup ("WET")=1
	Use w: "\\hei01cam01\frontline"

		EndIf

If InGroup ("STGSG-FTP")=1
	Use z: "\\stgscts01\FTP\STGSG"

		EndIf

If InGroup ("AssemblyDrive")=1
	Use w: "\\stgscfile02\company\18.Assembly"
		EndIf

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

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

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



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

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

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




Return	
; Draw progress bar
:DRAW_PROGRESS

	; Setup progress bar ajustment
	$AjustProgress = $Progress + $AjustProgress	
	     
	; Bump progress up
	While $Progress <= $AjustProgress
		
		; Diplay curent progress
		Color Y+/N
		At (20, 22 + $Progress) Chr (219)	
		$Progress = $Progress + 1	
		
	Loop

	
Return


Top
#199814 - 2010-09-10 10:48 PM Re: Write Registry Key based on Computername [Re: JSP]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4447
Loc: USA
There may be more sensitive info in this script but I modified the email address and replaced the passwords with "password".
Top
#199816 - 2010-09-10 11:51 PM Re: Write Registry Key based on Computername [Re: Allen]
JSP Offline
Fresh Scripter

Registered: 2010-09-01
Posts: 12
Loc: Phoenix AZ
 Originally Posted By: Allen
There may be more sensitive info in this script but I modified the email address and replaced the passwords with "password".


Thanks, didn't even think to look for that. How do you get the code to go inside that box?

Top
#199817 - 2010-09-11 01:41 PM Re: Write Registry Key based on Computername [Re: JSP]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4285
Loc: New Jersey
Use "code" tags - put the word "code" inside of square brackets at the beginning, and "/code" at the end - like this - [ code ] my program... [ /code ] - but without any spaces.

Still want to know what editor you use.

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

Top
#199818 - 2010-09-12 01:41 AM Re: Write Registry Key based on Computername [Re: Glenn Barnas]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4447
Loc: USA
There so much code there... hard to tell if there are more but here is one mis-matched quote. Really no need for the quote around the 1.

 Code:
		'Writing NeedCommonFiles "A": '
		$=WriteValue('HKEY_CURRENT_USER\Software\Lotus\Notes\8.0', 'NeedCommonFiles', 1, 'Reg_DWord')

Top
Page 1 of 2 12>


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

Who's Online
0 registered and 35 anonymous users online.
Newest Members
thequeen, ameliaryan, shalomsalami, dkdssdk, Vroon
17639 Registered Users

Generated in 0.045 seconds in which 0.013 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