Jump to content

.BAT space question

Rich.m
Go to solution Solved by Oshino Shinobu,
Just now, Rich.m said:

yes, I am actually exe 6 at once.

In that case, you can use the cd as you already have and keep the format of

start .\"Program name".exe

Though you don't need the quotes if there's no space, but it would still work with them. 

So normally in batch files, they look like so:

@echo off
cd C:\Program Files (x86)\Razer\Synapse\
start RzSynapse.exe
exit

and all is good with the world, 

But not today my friends!

my issue is here:

cd C:\Program Files (x86)\Razer\Synapse3\WPFUI\Framework\Razer Synapse 3 Host\
start Razer Synapse 3.exe

SO the "start Razer space Synapse space 3.exe" is not ok in this manor. and I'm having a hell of a good time trying to work around this.

" " should say, Hey expect spacing here! it does not.. and most everything I have searched addresses directory path's but not so much this challenge.

I know this has to be so simple, I'm overlooking it. Anyone have any leads for me to search or maybe an example? 
.

Link to comment
Share on other sites

Link to post
Share on other sites

start C:\"Program Files (x86)"\Razer\Synapse3\WPFUI\Framework\"Razer Synapse 3 Host"\"Razer Synapse 3".exe

or

start C:\"Program Files (x86)\Razer\Synapse3\WPFUI\Framework\Razer Synapse 3 Host\Razer Synapse 3".exe

 

 

If you want to change directory and then start it:

cd "C:\Program Files (x86)\Razer\Synapse3\WPFUI\Framework\Razer Synapse 3 Host"
start .\"Razer Synapse 3.exe"

 

Link to comment
Share on other sites

Link to post
Share on other sites

No, that opens CMD and requires ???.exe to manually be entered.

Link to comment
Share on other sites

Link to post
Share on other sites

C:\Program Files (x86)\Razer\Synapse3\WPFUI\Framework\Razer Synapse 3 Host>C:\Program Files (x86)\Razer\Synapse3\WPFUI\Framework\Razer Synapse 3 Host>

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, Rich.m said:

No, that opens CMD and requires ???.exe to manually be entered.

Could you post the command you tried exactly as it's written in the batch file? I've just tested it, works fine. 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Rich.m said:
  • Oshino Shinobu ok yah that does work. not sure why it didnt go the first try, lol.

If you wanted to keep the cd command first, you'd need to launch it as below. Can't see any particular reason to do so though unless you're launching multiple from the same directory. 

 

cd %path%
start .\"Razer Synapse 3".exe

 

Link to comment
Share on other sites

Link to post
Share on other sites

Thank you, your help has been very appreciated 🙂

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Rich.m said:

yes, I am actually exe 6 at once.

In that case, you can use the cd as you already have and keep the format of

start .\"Program name".exe

Though you don't need the quotes if there's no space, but it would still work with them. 

Link to comment
Share on other sites

Link to post
Share on other sites

enter the drive letter first , then the CD command to move to a different folder, then run the application

 

@echo off
C:\
cd "C:\Program Files (x86)\Razer\Synapse"
start RzSynapse.exe
exit

You don't need to use start unless you want to use it for tricks like launching application minimized, or to change priority

As the start.exe is in Windows folder somewhere, start.exe may look for RzSynapse.exe in the same folder where start.exe is located. 

As it is written above, it should pick RzSynapse.exe from the folder, BUT you can specify manually the folder...

 

start /D "C:\Program Files (x86)\Razer\Synapse" /MIN RzSynapse.exe

The command above will start RzSynapse from the program files folder and will start it minimized...

 

C:\Users\mariush>start /?
Starts a separate window to run a specified program or command.

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.
    path        Starting directory.
    B           Start application without creating a new window. The
                application has ^C handling ignored. Unless the application
                enables ^C processing, ^Break is the only way to interrupt
                the application.
    I           The new environment will be the original environment passed
                to the cmd.exe and not the current environment.
    MIN         Start window minimized.
    MAX         Start window maximized.
    SEPARATE    Start 16-bit Windows program in separate memory space.
    SHARED      Start 16-bit Windows program in shared memory space.
    LOW         Start application in the IDLE priority class.
    NORMAL      Start application in the NORMAL priority class.
    HIGH        Start application in the HIGH priority class.
    REALTIME    Start application in the REALTIME priority class.
    ABOVENORMAL Start application in the ABOVENORMAL priority class.
    BELOWNORMAL Start application in the BELOWNORMAL priority class.
    NODE        Specifies the preferred Non-Uniform Memory Architecture (NUMA)
                node as a decimal integer.
    AFFINITY    Specifies the processor affinity mask as a hexadecimal number.
                The process is restricted to running on these processors.

                The affinity mask is interpreted differently when /AFFINITY and
                /NODE are combined.  Specify the affinity mask as if the NUMA
                node's processor mask is right shifted to begin at bit zero.
                The process is restricted to running on those processors in
                common between the specified affinity mask and the NUMA node.
                If no processors are in common, the process is restricted to
                running on the specified NUMA node.
    WAIT        Start application and wait for it to terminate.
    command/program
                If it is an internal cmd command or a batch file then
                the command processor is run with the /K switch to cmd.exe.
                This means that the window will remain after the command
                has been run.

                If it is not an internal cmd command or batch file then
                it is a program and will run as either a windowed application
                or a console application.

    parameters  These are the parameters passed to the command/program.

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×