Professional Documents
Culture Documents
p9 Ins Vedant
p9 Ins Vedant
p9 Ins Vedant
Practical-9
9.Aim: Write a program that creates a shortcut file.
Code:
@echo off
set /p source="Enter the full path of the file: "
set /p shortcut="Enter the full path for the shortcut: "
mklink "%shortcut%"
"%source%"
echo Shortcut created successfully!
Pause
Save the file with a .bat extension, for example, create, shortcut.bat. Double-click on the
create_shortcut.bar file to run the script.
When prompted, enter the full path of the file for which you want to create a shortcut, and then
enter the full path where you want to create the shortcut file. If the shortcut was createdsuccessfully,
you should see the message "Shortcut created successfully!" displayed in the command prompt
window.