Run a shortcut with a batch file

Isaac OConnor

I am trying to set up multiple steam accounts, and you can instantly launch an account by making a shortcut for it, blah blah blah. The shortcuts works fine but I want to make a batch file to select which account to use, then launch the shortcut for that account. For some reason I can't find out how to launch a shortcut from a batch file. I have searched and searched but I cannot find how. Everything seems to work up until launching the shortcut which does nothing.

Here is my code

    @echo off
    echo Which steam account to use?
    echo ---------------------------
    cd "C:\Program Files (x86)\Steam"
    TIMEOUT 2 >null
    echo 1. user1
    TIMEOUT 2 >null
    echo 2. user2
    set /p account="Select a number. "
    echo %account%
    TIMEOUT 2 >null
    if %account%==1 (
        echo Account "user1" selected.
        TIMEOUT 3 >null
        start "C:\Program Files (x86)\Steam\user1.lnk"
        )
    IF %account%==2 (
        echo Account "user2" selected.
        TIMEOUT 3 >null
        start "C:\Program Files (x86)\Steam\user2.lnk"
        )

Running Windows 8.

Anon Coward

The help for start contains this tidbit:

START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
      [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
      [/NODE <NUMA node>] [/AFFINITY <hex affinity mask>] [/WAIT] [/B]
      [command/program] [parameters]

    "title"     Title to display in window title bar.

In other words the first quoted string will be used for the title. To launch something with quotes, you need to provide a quoted string before it, like this:

start "" "C:\Program Files (x86)\Steam\user1.lnk"

Since it's not a program with a console window, the contents don't matter, they won't be used.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Run a shortcut with a batch file

From Dev

Get Batch file to run relative to actual folder, not shortcut

From Dev

Launch a shortcut using batch file

From Dev

Get the directory of shortcut to a batch file

From Dev

Batch File Run VBScript

From Dev

How to run this "batch" file?

From Dev

Batch file does not run

From Dev

batch file that emulates key shortcut Home + D

From Dev

batch file that emulates key shortcut Home + D

From Dev

Run PHP file in batch file

From Dev

Internet Explorer 8 "Run with different credentials" shortcut - batch script option?

From Dev

Use CreateProcess to Run a Batch File

From Dev

Compiled batch file run fullscreen

From Dev

Run Batch file in Visual Basic

From Dev

Compiled batch file run fullscreen

From Dev

Run "./" bash/batch file with cygwin

From Dev

Run Batch File from R

From Dev

run batch file in all subfolders

From Dev

Batch file, script or shortcut to delete the most recent file in a specified folder

From Dev

Run a compiled batch file (exe) file through a batch file

From Dev

Error - to run php file using batch file

From Dev

Run a batch file ignoring the variables in the file name

From Dev

Getting the source .exe file name from .lnk shortcut in batch script?

From Dev

How to create shortcut with icon on desktop using Batch file?

From Dev

Running a custom batch file on keyboard shortcut in current directory

From Dev

Shortcut to batch file cannot be pinned to Win10 Start menu

From Dev

Create a batch file or shortcut to PuTTY (ssh) that opens a session and runs a command

From Dev

How to create shortcut with icon on desktop using Batch file?

From Dev

How can i get a batch file to copy a .lnk shortcut to the desktop

Related Related

HotTag

Archive