[THIN] Re: Mass edit on TS users HKCU

  • From: Spriggs Jon <Jon.Spriggs@xxxxxxxxxxxxxx>
  • To: thin@xxxxxxxxxxxxx
  • Date: Thu, 17 Feb 2005 08:39:37 -0000

Hi Ron,

I think your first problem is that you're not getting the username variable
correctly...

Try using this snippet instead...

Sub RegistryChanges
Dim objShell, objNetwork
Dim strUsername, strRegPath, strRegVar
Set objShell = Wscript.CreateObject("Wscript.Shell")
Set objNetwork = Wscript.CreateObject("Wscript.Network")

strUsername = objNetwork.Username

strRegPath = "HKCU\Software\XYZ Corp\ProgramName\CategoryBurnImageLocation"
strRegVar = "C:\Documents and Settings\" & strUsername & "\Application
Data\XYZ Corp\ProgramFolder"

objShell.RegWrite strRegPath, strRegVar

End Sub

Hope that helps :)

Jon Spriggs
-- 
The presence of a "Fujitsu" address does not imply or assume that Fujitsu
Services, Fujitsu or any other company containing the Fujitsu name uses or
endorses this product. This email is purely a personal opinion.

-----Original Message-----
From: Ron Jameson [mailto:rjameson@xxxxxxxxxxxxx] 
Sent: 17 February 2005 02:52
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Mass edit on TS users HKCU


Anybody familiar with mass edits in a terminal server registry for the HKCU
(which ends up being HK Users the the SID)?  I am trying to adjust/tweak
each users registry setting via the login VBS script but cannot find a way
to pass the username variable into the script while using the
wshell.regwrite method.

Example:  

Sub RegistryChanges

Dim wshshell
Set wshshell = WScript.CreateObject("WScript.Shell")

wshshell.regwrite "HKCU\Software\XYZ
Corp\ProgramName\CategoryBurnImageLocation", "C:\Documents and
Settings\%USERNAME%\Application Data\XYZ Corp\ProgramFolder"

End Sub


I need to alter the path variable to match the users login name...but the
%username% is not passing to the registry when I test it.

Any clues?

Ron
Hamlin Technologies
********************************************************
This Weeks Sponsor: RTO Software TScale
TScale provides a cost-effective way to improve performance, capacity and
stability for thin-client servers like Citrix MetaFrame or Microsoft
Terminal Services running Windows NT, 2000 or 2003.
http://www.rtosoft.com/enter.asp?id)6
********************************************************** 
Useful Thin Client Computing Links are available at:
http://thin.net/links.cfm ThinWiki community - Excellent SBC Search
Capabilities! http://www.thinwiki.com
***********************************************************
For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link:
http://thin.net/citrixlist.cfm
********************************************************
This Weeks Sponsor: RTO Software TScale
TScale provides a cost-effective way to improve performance, capacity and 
stability for thin-client servers like Citrix MetaFrame or Microsoft Terminal 
Services running Windows NT, 2000 or 2003.
http://www.rtosoft.com/enter.asp?id=296
********************************************************** 
Useful Thin Client Computing Links are available at:
http://thin.net/links.cfm
ThinWiki community - Excellent SBC Search Capabilities!
http://www.thinwiki.com
***********************************************************
For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link:
http://thin.net/citrixlist.cfm

Other related posts: