Windows OS & System Related Tips

Starting Your Application When Windows Boots
Add a string entry in HKLM\Software\Microsoft\Windows\CurrentVersion\Run. The entry's name should be the name of your application (ex: MyApp). Its value must be the short path to your application (ex. C:\Windows\MyApp.exe). See my VB6 Convert Long Path Names example.

Display Modal Message Box on Window's Startup
Windows can display a modal dialog box when it boots. You can specify the dialog’s caption and text. Add or change:

        LegalNoticeCaption = "enter the caption"
        LegalNoticeText = "enter the text"


    HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinLogon
        LegalNoticeCaption = "enter the caption"
        LegalNoticeText = "enter the text"

Suppressing Window's Start Up Logo
To suppress the animated Microsoft logo bitmap edit C:\MSDOS.SYS using Notepad. Be sure you can view hidden and system files in Explorer to see this file. You can also enter C: <enter> then ATTRIB -R -S -H MSDOS.SYS at a DOS prompt. Once you edit the file, fintd the [Options] line and insert logo=0 as the next line. If you see a line that says logo=1, delete it. Save the file. The logo will not display the next time you boot up.

Lock Win2K, WinXP Instantly from VB
Windows 2000 has a LockWorkStation function that locks can lock the PC easily.

   Private Declare Function LockWorkStation Lib user32.dll() As Long

   Call LockWorkStation

Clear your Swap File when Windows XP Shuts Down
Edit this Registry key: HKLM\System\CurrentControlSet\Control\SessionManager\Memory management. Then add or set the Dword value ClearPageFileAtShutdown to 1. Doing this can prevent hacker from gathering information from this file.

Stop Windows XP from Creating a Dump File
A dump file stores data from memory when during a system crash. It can expose unencrypted data to hackers. Stop dumps file creation by going to Control Panel | System. Click on the Advanced tab then the Settings button under Startup and Recovery. Set the drop down under Write Debug Information to None. Next, use Regedt32 (not Regedit) to edit this Registry key: HKLM\Software\Microsoft\WindowsNT\CurrentVersion\AEDebug and set the Auto string to 0. Then use Explorer and goto Documents and Settings\All Users\Shared Documents\DrWatson and delete User.dmp and Drwtsn32.log.

Control how Applications take Focus
When a background app wants to take focus it flashes its toolbar icon 3 times and waits for you to click it. You can change the number of flashes or have it take focus immediately. Edit this Registry key: HKCU\Control Panel\Desktop. Then add or set the Dword values ForegroundFlashCount to the number of flashes (0 = infinite) and ForegroundLockTimeOut where 0 = immediate and 200000 is the default.

End Crashed Programs Faster
You can change the amount of time Windows waits to terminate a task when you click End Task after pressing Ctrl-Alt-Del. You can change the value which is in milliseconds. Try setting these values under HKCU\Control Panel\Desktop to 1000 milliseconds. HungAppTimeOut (String) and WaitToKillAppTimeOut (String).

To make Windows automatically end a hung task, go to HKCU\Control Panel\Desktop and add or change the AutoEndTasks (DWORD) value to 1. To set it back, set it to 0.

Create a Non-Centered Desktop Wallpaper
Edit this Registry key: HKCU\Control Panel\Desktop. Then add or set the String values WallPaperOriginX and WallPaperOriginY and set their values to the desired x and y coordinates of the top left-hand corner.

Clean Up Your Registry in Pre WinXP OS's
To clean up the registry and remove unused space boot to a DOS prompt and run Scanreg as follows: Scanreg /opt. To fix a corrupt registry use this command: Scanreg /fix.

Getting Window's Version
Look in HKLM\Software\Microsoft\Windows\CurrentVersion. Check the Version, VersionNumber and SubVersionNumber entries. These are the values shown when you right click My Computer and select properties

Determining the Current User Programmatically
Use the GetUserName API function or look at

        Current User = "user name"

Set Your Computer's Name
To set your computer’s name, as displayed under the Identification tab in Control Panel’s Network applet, change:

        ComputerName = "new name"

Registered Owner Name
To change the values that displays when you right click My Computer and select properties, change:

        RegisteredOwner = "your name"
        RegisteredOrganization = "your company name"

Change System Icons
Look under HKCR\CLSID\Class ID\DefaultIcon where Class ID is from the following table. Change the default value to the path and index of the icon you want to use. If you are not sure of the icon’s index, use 0 for the first icon in the file. You can use my Extract Icon program to view all icons in a particular file.

System Icon

Class ID

My Computer


Network Neighborhood




Recycle bin


Putting Your Monitor in Power Saver Mode
To turn off the monitor:

   SendMessage(AnyForm.hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, 2&)

Standby monitor:

   SendMessage(AnyForm.hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, 1&)

To turn on the monitor:

   SendMessage(AnyForm.hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, -1&)


   Const WM_SYSCOMMAND = &H112

About TheScarms
About TheScarms

Sample code
version info

If you use this code, please mention ""

Email this page

© Copyright 2016 TheScarms
Goto top of page