Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6997859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:20:12+00:00 2026-05-27T20:20:12+00:00

I have a windows.bat file which is actually my custom installer. When everything is

  • 0

I have a windows.bat file which is actually my custom installer. When everything is installed i finally need to create one desktop shortcut icon, which has icon, and link to execute my Java jar. I successfully made one but its using VBS, what i am trying to do now is avoid using VBS but do it completely using BATCH file only. But how do i make this following in BATCH file?

Example:

enter image description here

1) Create an empty file vbs.vbs and paste this code to desktop

set WshShell = WScript.CreateObject("WScript.Shell" ) 
strDesktop = WshShell.SpecialFolders("AllUsersDesktop" ) 
set oShellLink = WshShell.CreateShortcut(strDesktop & "\StackOverflow shortcut.lnk") 
oShellLink.TargetPath = "c:\application folder\application.exe" 
oShellLink.WindowStyle = 1 
oShellLink.IconLocation = "c:\application folder\application.ico" 
oShellLink.Description = "Shortcut Script" 
oShellLink.WorkingDirectory = "c:\application folder" 
oShellLink.Save 

2) Double click the the vbs.vbs file and instantly it creates a shortcut file
in the desktop tested in Windows XP works

But how do i skip the VBS process and do it completely from my BATCH script?
(Is there any way using RUNDLL32.EXE APPWIZ.CPL,NewLinkHere (Dest))

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:20:13+00:00Added an answer on May 27, 2026 at 8:20 pm

    This was asked and answered before here:

    creating a shortcut for a exe from a batch file

    One of the provided answers (not the accepted one) has this link:

    http://www.robvanderwoude.com/amb_shortcutsnt.php

    The relevant script is:

    @echo off & setlocal
    ::For Windows NT 4.0 users only!!!
    ::Creates LNK and PIF files from the command line.
    ::Author: Walter Zackery
    if not %1[==[ if exist %1 goto start
    echo You must pass the path of a file or folder to the
    echo batch file as a shortcut target.
    if not %1[==[ echo %1 is not an existing file or folder
    (pause & endlocal & goto:eof)
    :start
    (set hkey=HKEY_CURRENT_USER\Software\Microsoft\Windows)
    (set hkey=%hkey%\CurrentVersion\Explorer\Shell Folders)
    (set inf=rundll32 setupapi,InstallHinfSection DefaultInstall)
    start/w regedit /e %temp%\#57#.tmp "%hkey%"
    
    for /f "tokens=*" %%? in (
    'dir/b/a %1? 2^>nul') do (set name=%%~nx?)
    
    for /f "tokens=2* delims==" %%? in (
    'findstr/b /i """desktop"""= %temp%\#57#.tmp') do (set d=%%?)
    
    for /f "tokens=2* delims==" %%? in (
    'findstr/b /i """programs"""= %temp%\#57#.tmp') do (set p=%%?)
    
    (set d=%d:\\=\%) & (set p=%p:\\=\%)
    if not %2[==[ if exist %~fs2\nul (set d=%~fs2)
    if not %2[==[ if exist %~fs2nul (set d=%~fs2)
    set x=if exist %2\nul
    if not %2[==[ if not %d%==%2 %x% if "%~p2"=="\" set d=%2
    echo %d%|find ":\" >nul||(set d=%d%\)
    (set file=""""""%1"""""")
    for /f "tokens=1 delims=:" %%? in ("%file:"=%") do set drive=%%?
    (set progman=setup.ini, progman.groups,,)
    echo > %temp%\#k#.inf [version]
    echo >>%temp%\#k#.inf signature=$chicago$
    echo >>%temp%\#k#.inf [DefaultInstall]
    echo >>%temp%\#k#.inf UpdateInis=Addlink
    echo >>%temp%\#k#.inf [Addlink]
    echo >>%temp%\#k#.inf %progman% ""group200="}new{"""
    echo >>%temp%\#k#.inf setup.ini, group200,, """%name%"",%file%
    start/w %inf% 132 %temp%\#k#.inf
    del %temp%\#k#.inf %temp%\#57#.tmp
    move %p%\"}new{\*.*" %d% >nul 2>&1
    rd %p%\}new{ 2>nul
    move %p%\}new{.lnk %d%\"drive %drive%.lnk" >nul 2>&1
    endlocal
    

    Not sure if that will fly all the way into Win7 and 8

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a shell and bat file in which I need to
I have a script which detects OS using Catalina.bat for windows and Catalina.sh for
I have a batch file which is on a usb key. I need to
I have created a bat file which calls selenium server called run-selenium-server.bat which has:
I'm creating an MSI installer using WiX and I have, say, a *.bat file
I have a Windows batch script (my.bat) which has the following line: DTBookMonitor.exe 2>&1
I have Windows File sharing enabled on an OS X 10.4 computer. It's accessible
I have Windows Vista MCML app, and I need to figure out the current
I'm coming at this from the Windows world... On Windows, we have Windows Installer
I have a bat script in which gets all files in a folder and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.