How do i make a folder shortcut wiht Batch Commando Prompt?
i have tried this:
copy "C:\Windows" "C:\Users\%username%\Desktop\Windows.ink"
mklink "C:\Windows" "C:\Users\%username%\Desktop"
How do i make a folder shortcut wiht Batch Commando Prompt?
i have tried this:
copy "C:\Windows" "C:\Users\%username%\Desktop\Windows.ink"
mklink "C:\Windows" "C:\Users\%username%\Desktop"
@echo off
call :createDesktopShortcut "%~1" "%~2"
exit /b
:createDesktopShortcut targetOfShortcut nameOfShortcut
if not exist "%~f1" goto :eof
setlocal & set "tempFile=%temp%\%~nx0.vbs.tmp" & set "name=%~2" & if not defined name set "name=%~n1"
echo(Set S=WScript.CreateObject("Wscript.Shell"):With S.Createshortcut(S.SpecialFolders("Desktop")+"\%~2.lnk"):.TargetPath="%~f1":.Save:End With>"%tempFile%"
cscript //nologo //e:vbscript "%tempFile%">nul & del /f /q "%tempFile%" >nul 2>nul
endlocal & goto :eof
Save as createDesktopShortcut.cmd
and call it as
createDesktopShortcut.cmd "%windir%" "Win directory"