Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Set WshShell = CreateObject("Wscript.Shell")
WshShell.Run ("CMD.EXE /K color 9f & dir")
ChangeCScriptWindowColours
CheckEngine ' to force the script to run in a 'DOS' box
'---------------------------------------------------------
Sub ChangeCScriptWindowColours
Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\"&_
strComputer & "\root\default:StdRegProv")
strKeyPathShort = "Console\%SystemRoot%_system32_CSCRIPT.EXE"
strValueName = "ScreenColors"
strValue = "31" ' Bright white text on a dark blue background
Return = objReg.SetDWordValue &_
(HKEY_CURRENT_USER,strKeyPathShort,strValueName,strValue)
End Sub
'---------------------------------------------------------
Sub CheckEngine
pcEngine = LCase(Mid(WScript.FullName, InstrRev(WScript.FullName,"\")+1))
If Not pcEngine="cscript.exe" Then
'wscript.echo " Engine = " & pcengine
Set objWshShell = CreateObject("WScript.Shell")
objWshShell.Run "CSCRIPT.EXE /nologo """ & WScript.ScriptFullName & """"
WScript.Quit
End If
End Sub
' Registry entries for forcing the colours in the cscript box:
Const HKEY_CLASSES_ROOT = &H80000000
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const HKEY_USERS = &H80000003
Const HKEY_CURRENT_CONFIG = &H80000005
'Create and populate a dictionary object containing the registry settings
'required to create a cscript 'DOS' box of bright white text on a blue background.
Set RegValues = CreateObject("Scripting.Dictionary")
RegValues.Add "ScreenBufferSize", "65470584"
RegValues.Add "FontSize", "786440"
RegValues.Add "FontFamily", "48"
RegValues.Add "FontWeight", "400"
RegValues.Add "HistoryNoDup", "0"
RegValues.Add "ScreenColors", "31"
ChangeCScriptWindowColours
Sub ChangeCScriptWindowColours
strComputer = "."
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\"&_
strComputer & "\root\default:StdRegProv")
strKeyPathShort = "Console\%SystemRoot%_system32_CSCRIPT.EXE"
' Create key to use
Return = objReg.CreateKey(HKEY_CURRENT_USER, strKeyPathShort)
If (Return = 0) And (Err.Number = 0) Then
'Wscript.Echo " HKEY_CURRENT_USER\" & strKeyPathShort & " created"
Else
Wscript.Echo " CreateKey failed. Error = '" & Err.Number & "' and Return = '" & Return & "'"
end if
Err.Clear
Return = ""
RegValueKeys = RegValues.keys 'Get the keys
RegValueItems = RegValues.Items 'Get the keys
'For Each value1 In RegValueKeys
For i = 0 To RegValues.Count -1
strValueName = RegValueKeys(i) 'Print key
strValue = RegValueItems(i) 'Print item
Return = AddCScriptColourValues(strValueName,strValue)
Next
End Sub
'---------------------------------------------------------
Function AddCScriptColourValues(strValueName,strValue)
Return = objReg.SetDWordValue(HKEY_CURRENT_USER,strKeyPathShort,strValueName,strValue)
If (Return = 0) And (Err.Number = 0) Then
'Wscript.Echo " HKEY_CURRENT_USER\" & strKeyPathShort & "\" & strValueName &_
"\" & strValue & " created"
Else
Wscript.Echo " SetDWordValue failed. Error = '" & Err.Number & "' and Return = '" & Return & "'"
end if
End Function