问题
I know two ways to remove the logo permanently. The "official" one:
cscript //Nologo //S
Will save current command line options for current user.
A ftype
approach with admin privileges:
ftype wsffile="%SystemRoot%\System32\CScript.exe" //nologo "%%1" %%*
ftype jsfile="%SystemRoot%\System32\CScript.exe" //nologo "%%1" %%*
ftype vbsfile="%SystemRoot%\System32\CScript.exe" //nologo "%%1" %%*
Double-%
's are needed only if you use the lines in a batch file.
The latter will all users via affect the reg key HKEY_CLASSES_ROOT\<file>\Shell\Open\Command
, where <file>
can be wsffile
, jsfile
or vbsfile
.
Do you know where are stored the cscript //Nologo //S
settings?
回答1:
The logo settings are saved in the DWORD value DisplayLogo
the subkey Software\Microsoft\Windows Script Host\Settings
under both HKEY_LOCAL_MACHINE
and HKEY_CURRENT_USER
(HKEY_USERS\<SID>
, actually).
To change the default setting for all users set the value in HKEY_LOCAL_MACHINE
to 0x0
:
reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v DisplayLogo /t REG_DWORD /d 0x0 /f
To change the setting for the current user set the value in HKEY_CURRENT_USER
to 0x0
:
reg add "HKCU\Software\Microsoft\Windows Script Host\Settings" /v DisplayLogo /t REG_DWORD /d 0x0 /f
If you want to modify the settings for other users, you'll have to load their user hive into the registry first.
来源:https://stackoverflow.com/questions/17389335/permanent-removal-of-logo-in-windows-scripting-host-wsh-scripts