Page 1 of 1 1
Topic Options
#165013 - 2006-07-24 03:54 PM WRITEVALUE brings up "script error : unknown command !."
darkblueturbo Offline
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
#165014 - 2006-07-24 04:06 PM Re: WRITEVALUE brings up "script error : unknown command !."
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
WRITEVALUE ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DontDisplayLastUserName", "0", REG_SZ")

you have a quote (") behind REG_SZ. Remove it and try again.

Top
#165015 - 2006-07-24 04:08 PM Re: WRITEVALUE brings up "script error : unknown command !."
DrillSergeant Offline
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
#165016 - 2006-07-24 04:15 PM Re: WRITEVALUE brings up "script error : unknown command !."
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Sarg you just got golfed
You: 126
Me: 112

Code:

WRITEVALUE ("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DontDisplayLastUserName", "0", "REG_SZ")



Edited by Mart (2006-07-24 04:16 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#165017 - 2006-07-24 04:37 PM Re: WRITEVALUE brings up "script error : unknown command !."
DrillSergeant Offline
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 Offline
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 Offline
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
#165020 - 2006-07-25 04:42 AM Re: WRITEVALUE brings up "script error : unknown command !."
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
IIRC on XP, the policy section of HKCU also needs admin rights to modify.
Top
#165021 - 2006-07-25 06:29 AM Re: WRITEVALUE brings up "script error : unknown command !."
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Yes, correct. Think he finally saw that and is now going to look at using GPO for the change.
Top
Page 1 of 1 1


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

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.073 seconds in which 0.037 seconds were spent on a total of 12 queries. Zlib compression enabled.

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