#165013 - 2006-07-24 03:54 PM
WRITEVALUE brings up "script error : unknown command !."
|
darkblueturbo
Lurker
Registered: 2006-07-24
Posts: 3
|
Hi there, This is my first post and I'm not sure it's in the right place (though it's regarding a script error, so it should be). I've been searching but can't find anything relating to this, (but lots of interesting info) so hopefully one of you will be able to me.
I think it's a pretty basic thing, I'm just obviously missing a trick.
The line of my script that brings up the error, "script error : unknown command !.", is:
WRITEVALUE ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DontDisplayLastUserName", "0", REG_SZ")
I am assuming this is something to do with the space in "Windows NT". How would I need to write this for Kix to recognise it? If it was a folder I would simply use "Window~1" (or 2, or 3) but this hasn't worked for the script.
As I say, I'm pretty sure this is a real obvious one for an experienced Kix scripter but it's got me stumped...
Cheers DBT
|
|
Top
|
|
|
|
#165015 - 2006-07-24 04:08 PM
Re: WRITEVALUE brings up "script error : unknown command !."
|
DrillSergeant
MM club member
   
Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
|
oops... I meant... put REG_SZ between quotes: Code:
WRITEVALUE ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DontDisplayLastUserName", "0", "REG_SZ")
|
|
Top
|
|
|
|
#165017 - 2006-07-24 04:37 PM
Re: WRITEVALUE brings up "script error : unknown command !."
|
DrillSergeant
MM club member
   
Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
|
LOL, Mart
btw, I was thinking of removing the quotes around the zero, and I found this:
Quote:
Windows 2000 or XP Open [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System] and create a new string value, or modify the existing value, called "DontDisplayLastUserName" and set it to "1" to enable or "0" to disable the restriction.
Windows NT Open [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] and create a new string value, or modify the existing value, called "DontDisplayLastUserName" and set it to "1" to enable or "0" to disable the restriction.
and if you'd like to use it in your logon-script you'd probably want to set it in the HKEY_CURRENT_USER because the users can't write in the HKEY_LOCAL_MACHINE.
Quote:
User Key: [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System] Value Name: DontDisplayLastUserName Data Type: REG_DWORD (DWORD Value) Value Data: (1 = remove username)
|
|
Top
|
|
|
|
#165018 - 2006-07-24 04:51 PM
Re: WRITEVALUE brings up "script error : unknown command !."
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: Space
|
Actually normal users typically don't have rights to write in the policy section of HKCU either on purpose. Without being Golf happy this will work fine except perhaps for permissions Code:
$RC = WriteValue('HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System','DontDisplayLastUserName',0,REG_SZ)
|
|
Top
|
|
|
|
#165019 - 2006-07-24 05:01 PM
Re: WRITEVALUE brings up "script error : unknown command !."
|
darkblueturbo
Lurker
Registered: 2006-07-24
Posts: 3
|
What a prat...! Thanks :-)
Still didn't work though... I'll make this change via Group Policy instead.
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|