r/Batch • u/DramaticYak3260 • Feb 12 '20
Batch shortcut
Hello,I need help creating a batch shortcut on my Desktop,can somebody upload a batch command ?
1
u/MidgetSpinner64_exe Feb 12 '20
@echo off cd “[location of file]” Start [file name (example: steam.exe)] Exit
0
u/DramaticYak3260 Feb 12 '20
I don't want to open it,I want to create a shortcut :(
1
u/MidgetSpinner64_exe Feb 12 '20
As in a shortcut to a folder?
0
u/DramaticYak3260 Feb 12 '20
On my Desktop
3
u/grizlipiprim Feb 12 '20
Right click on batch file, click on "create shortcut", copy shortcut to desktop.
0
u/DramaticYak3260 Feb 12 '20
I know how to do this I want to do it via commands for an upcoming project :D
4
u/demux4555 Feb 12 '20
let me guess
you want to put a shortcut on someone's desktop named "Firefox", "My Computer", or "Nude babushkas"... to trick someone into executing your deadly virus bat script?
-1
u/DramaticYak3260 Feb 13 '20
No,I want to test how many icons can a Desktop/folder hold without taking too long to open
1
u/Nissingmo Feb 13 '20
So you’re looking for a way to create a shortcut .... through the command line?
1
3
u/demux4555 Feb 13 '20
he's obviously trying to make someone's system unusable or crash. Probably wants to fill up their desktop with enough icons to make the login bog down to a point where you cannot use the system. If he just wanted to "test how many icons", he can do that by copying files in Explorer.
This is so dumb. Why is this user even still allowed to post here, tbh
2
Feb 12 '20
@echo off
set SCRIPT="%USERPROFILE%\AppData\Local\Temp\temp.vbs"
echo Set oWS = WScript.CreateObject("WScript.Shell") >> %SCRIPT% echo sLinkFile = "%USERPROFILE%\Desktop\myshortcut.lnk" >> %SCRIPT% echo Set oLink = oWS.CreateShortcut(sLinkFile) >> %SCRIPT% echo oLink.TargetPath = "%USERPROFILE%" >> %SCRIPT% echo oLink.Save >> %SCRIPT%
cscript /nologo %SCRIPT% del %SCRIPT%
1
5
1
u/jcunews1 Feb 13 '20
No need. You already have all of the commands.