The Right Click Menu or the Context Menu is the menu, which appears, when you right-click on the desktop or a file or folder in Windows.
This menu gives you added functionality by offering you actions you can take with the item.
Most programs like to stuff their commands in this menu.
.
1. Right-Click on Files
.
Launching a Batch File
Registry value (REG file)
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\<Action Name>] [HKEY_CLASSES_ROOT\*\shell\<Action Name>\command] @="\"C:\\Scripts\\MyScript.cmd\" \"%1""
%1 is optional; it allows transferring the file path to the script as argument
MyScript.cmd
@echo Action to the file %1 in progress… pause
.
Launching a VBScript File
Registry value (REG file)
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\<Action Name>] [HKEY_CLASSES_ROOT\*\shell\<Action Name>\command] @="Cscript \"C:\\Scripts\\MyScript.vbs\" \"%1""
%1 is optional; it allows transferring the file path to the script as argument
MyScript.vbs
Set Args = WScript.Arguments MsgBox(“Start action on the file ”&Args(0))
.
.
2. Right-Click on Folders
.
Launching a Batch File
Registry value (REG file)
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Folder\shell\<Action Name>] [HKEY_CLASSES_ROOT\Folder\shell\<Action Name>\command] @="\"C:\\Scripts\\MyScript.cmd\" \"%1""
%1 is optional; it allows transferring the folder path to the script as argument
MyScript.cmd
@echo Action to the folder %1 in progress… pause
.
Launching a VBScript File
Registry value (REG file)
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Folder\shell\<Action Name>] [HKEY_CLASSES_ROOT\Folder\shell\<Action Name>\command] @="Cscript \"C:\\Scripts\\MyScript.vbs\" \"%1""
%1 is optional; it allows transferring the folder path to the script as argument
MyScript.vbs
Set Args = WScript.Arguments MsgBox(“Start action on the folder ”&Args(0))
.
.
3. Right-Click on Background
.
Launching a Batch File
Registry value (REG file)
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\Background\shell\<Action Name>] [HKEY_CLASSES_ROOT\Directory\Background\shell\<Action Name>\command] @="\"C:\\Scripts\\MyScript.cmd\" \"%1""
%1 is optional; it allows transferring the folder path to the script as argument
MyScript.cmd
@echo Action to the folder %1 in progress… pause
.
Launching a VBScript File
Registry value (REG file)
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\Background\shell\<Action Name>] [HKEY_CLASSES_ROOT\Directory\Background\shell\<Action Name>\command] @="Cscript \"C:\\Scripts\\MyScript.vbs\" \"%1""
%1 is optional; it allows transferring the folder path to the script as argument
MyScript.vbs
Set Args = WScript.Arguments MsgBox(“Start action on the folder ”&Args(0))