Method 1, URL-style shortcut
echo [InternetShortcut] >>"%USERPROFILE%\Desktop\Paint.url"
echo URL="%SystemRoot%\system32\mspaint.exe" >>"%USERPROFILE%\Desktop\Paint.url"
echo IconIndex=0 >>"%USERPROFILE%\Desktop\Paint.url"
echo IconFile="%SystemRoot%\system32\mspaint.exe" >>"%USERPROFILE%\Desktop\Paint.url"
This method will, on most computers, present a prompt that it can't create file associations and end up doing nothing.
Hope experts can add code to add a description to the shortcut
Method 2, external command
shortcut.exe /f:"%USERPROFILE%\Desktop\Paint.lnk" /a:c /t:"%SystemRoot%\system32\mspaint.exe"
shutcut can be downloaded on this forum. Also hope experts can add code to add a description to the shortcut
Method 3, VBScript script
@echo
set shortCutPath="%USERPROFILE%\Desktop\Paint.lnk"
echo Dim WshShell,Shortcut>>tmp.vbs
echo Dim path,fso>>tmp.vbs
echo path="%SystemRoot%\system32\mspaint.exe">>tmp.vbs
echo Set fso=CreateObject("Scripting.FileSystemObject")>>tmp.vbs
echo Set WshShell=WScript.CreateObject("WScript.Shell")>>tmp.vbs
echo Set Shortcut=WshShell.CreateShortCut(%shortCutPath%)>>tmp.vbs
echo Shortcut.TargetPath=path>>tmp.vbs
echo Shortcut.Save>>tmp.vbs
"%SystemRoot%\System32\WScript.exe" tmp.vbs
@del /f /s /q tmp.vbs
pause
This method also hopes experts can add code to add a description to the shortcut
Method 4, winrar
@echo off
echo Path=%%SystemRoot%%\system32\>test.txt
echo Silent=^2>>test.txt
echo Overwrite=^1>>test.txt
echo Shortcut=D, "mspaint.exe", "\", "Create and edit pictures, as well as display and edit scanned pictures.", "Paint">>test.txt
start /wait winrar.exe a -r -ep1 -m1 -sfx -ztest.txt test.exe %SystemRoot%\system32\mspaint.exe
start /wait test.exe
del test.*
I don't quite understand the last two sentences of this method. Hope to get an explanation
Correspondence between hotkeys and values
833 - Ctrl + Shift + A
834 - Ctrl + Shift + B
835 - Ctrl + Shift + C
836 - Ctrl + Shift + D
837 - Ctrl + Shift + E
838 - Ctrl + Shift + F
.
.
1601 - Ctrl + Alt + A
1602 - Ctrl + Alt + B
1603 - Ctrl + Alt + C
1604 - Ctrl + Alt + D
1605 - Ctrl + Alt + E
1606 - Ctrl + Alt + F
echo [InternetShortcut] >>"%USERPROFILE%\Desktop\Paint.url"
echo URL="%SystemRoot%\system32\mspaint.exe" >>"%USERPROFILE%\Desktop\Paint.url"
echo IconIndex=0 >>"%USERPROFILE%\Desktop\Paint.url"
echo IconFile="%SystemRoot%\system32\mspaint.exe" >>"%USERPROFILE%\Desktop\Paint.url"
This method will, on most computers, present a prompt that it can't create file associations and end up doing nothing.
Hope experts can add code to add a description to the shortcut
Method 2, external command
shortcut.exe /f:"%USERPROFILE%\Desktop\Paint.lnk" /a:c /t:"%SystemRoot%\system32\mspaint.exe"
shutcut can be downloaded on this forum. Also hope experts can add code to add a description to the shortcut
Method 3, VBScript script
@echo
set shortCutPath="%USERPROFILE%\Desktop\Paint.lnk"
echo Dim WshShell,Shortcut>>tmp.vbs
echo Dim path,fso>>tmp.vbs
echo path="%SystemRoot%\system32\mspaint.exe">>tmp.vbs
echo Set fso=CreateObject("Scripting.FileSystemObject")>>tmp.vbs
echo Set WshShell=WScript.CreateObject("WScript.Shell")>>tmp.vbs
echo Set Shortcut=WshShell.CreateShortCut(%shortCutPath%)>>tmp.vbs
echo Shortcut.TargetPath=path>>tmp.vbs
echo Shortcut.Save>>tmp.vbs
"%SystemRoot%\System32\WScript.exe" tmp.vbs
@del /f /s /q tmp.vbs
pause
This method also hopes experts can add code to add a description to the shortcut
Method 4, winrar
@echo off
echo Path=%%SystemRoot%%\system32\>test.txt
echo Silent=^2>>test.txt
echo Overwrite=^1>>test.txt
echo Shortcut=D, "mspaint.exe", "\", "Create and edit pictures, as well as display and edit scanned pictures.", "Paint">>test.txt
start /wait winrar.exe a -r -ep1 -m1 -sfx -ztest.txt test.exe %SystemRoot%\system32\mspaint.exe
start /wait test.exe
del test.*
I don't quite understand the last two sentences of this method. Hope to get an explanation
Correspondence between hotkeys and values
833 - Ctrl + Shift + A
834 - Ctrl + Shift + B
835 - Ctrl + Shift + C
836 - Ctrl + Shift + D
837 - Ctrl + Shift + E
838 - Ctrl + Shift + F
.
.
1601 - Ctrl + Alt + A
1602 - Ctrl + Alt + B
1603 - Ctrl + Alt + C
1604 - Ctrl + Alt + D
1605 - Ctrl + Alt + E
1606 - Ctrl + Alt + F

