Re: Is the syntax correct? by mistral
mistral
Tue Sep 12 04:50:13 CDT 2006
"Alexander Mueller" <millerax@hotmail.com> wrote in message
news:4505dfa2$0$18479$9b4e6d93@newsspool3.arcor-online.net...
> 11.09.2006 20:20, mistral schrieb:
>
>> Need help to check is the syntax correct:
>>
>> WshShell.RegWrite
>> "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\ActiveDesktop"
>> "NoDeletingComponents"=dword:00000001
>> "NoEditingComponents"=dword:00000001
>> "NoCloseDragDropBands"=dword:00000001
>> "NoMovingBands"=dword:00000001
>>
>> Set WSHShell = CreateObject("WScript.Shell")
>> WSHShell.Run "RUNDLL32.EXE Shell32.dll,SHExitWindowsEx 0"
>>
>> WScript.quit
>>
>>
>> Is it OK?
>
> No
>
> The RegWrite-part uses argument-syntax for REGEDIT4-scripts (*.reg)
> For pure scripting you must put it into multiple calls:
>
> Set WSHShell = CreateObject("WScript.Shell")
> Const adKey =
> "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\ActiveDesktop\"
>
> WshShell.RegWrite adKey & "NoDeletingComponents", 1, "REG_DWORD"
> WshShell.RegWrite adKey & "NoEditingComponents", 1, "REG_DWORD"
> WshShell.RegWrite adKey & "NoCloseDragDropBands", 1, "REG_DWORD"
> WshShell.RegWrite adKey & "NoMovingBands", 1, "REG_DWORD"
>
> The Shutdown-command is syntactically ok, but iirc is no longer supported
> under XP (assuming XP is your OS). Use either WMI-Win32_Shutdown or the
> shell-util shutdown.exe for system-shutdown.
>
> MfG,
> Alex
---------------
Thanks for tipps.
In final part i meant Log off, not shutdown. Does anyone suggest a way to do
it in Vbscript. Thank you