|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Expect End of statementmodify 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 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 *** "Cameron Seiver" <CameronSei***@discussions.microsoft.com> wrote in message For one thing, you can't express a hex number that way. You neednews:A836E748-0BD0-4701-9741-038067CE68F9@microsoft.com... > WshShell.RegWrite > "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDrives", > 7FFFFF03, "REG_BINARY" &H7FFFFF03 "Cameron Seiver" <CameronSei***@discussions.microsoft.com> wrote in "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDrives",message news:A836E748-0BD0-4701-9741-038067CE68F9@microsoft.com > WshShell.RegWrite > > 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..." |
|||||||||||||||||||||||