Home All Groups Group Topic Archive Search About

Expect End of statement

Author
3 Jun 2005 4:51 AM
Cameron Seiver
I've written a script that runs as part of the group policy that is set to
modify the registry of the HKCU that hides all drives but one drive in
particular (H Drive).

The only problem is when i log in as a test user that has the GPO with the
script attched to it i get the following error

Line: 4
Char: 97
Error: Expect end of statement
Code 800A0401
Source: Microsoft VBScript Compilation Error.

My Script consists of the following code.
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")

WshShell.RegWrite
"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDrives",
7FFFFF03, "REG_BINARY"

Basic the script is designed to modify the value NoDrives which is a Binary
Value.
(Information obtained from
http://www.onecomputerguy.com/registry_tips.htm#hiding_drives)

Looking at the script i can't seem to find any problems. I've checked my
syntax for the code and it seems to be fine.
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthregwrite.asp)

How do i fix this problem.

Thank you

Author
3 Jun 2005 5:31 AM
Chandra
Probably this should be written as:

WshShell.RegWrite _
"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDriv
es", _
7FFFFF03, "REG_BINARY"



best Regards,
Chandra
http://groups.msn.com/SQLResource/
http://chanduas.blogspot.com/
---------------------------------------

*** Sent via Developersdex http://www.developersdex.com ***
Author
3 Jun 2005 1:18 PM
Jeff Johnson [MVP: VB]
"Cameron Seiver" <CameronSei***@discussions.microsoft.com> wrote in message
news:A836E748-0BD0-4701-9741-038067CE68F9@microsoft.com...

> WshShell.RegWrite
> "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDrives",
> 7FFFFF03, "REG_BINARY"

For one thing, you can't express a hex number that way. You need

    &H7FFFFF03
Author
3 Jun 2005 1:18 PM
Bob Butler
"Cameron Seiver" <CameronSei***@discussions.microsoft.com> wrote in
message news:A836E748-0BD0-4701-9741-038067CE68F9@microsoft.com
> WshShell.RegWrite
>
"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDrives",
> 7FFFFF03, "REG_BINARY"

7FFFFF03 is not a valid constant... try &H7FFFFF03 instead

--
Reply to the group so all can participate
VB.Net: "Fool me once..."