How to mention C:\Program Files in batchfile

后端 未结 7 2112
迷失自我
迷失自我 2021-02-01 17:03

I need to invoke an exe file in C:\\Program Files directory from a batch file.How can we mention the directory name \"Program Files\" in batch file.I am getting error like C:\\P

相关标签:
7条回答
  • 2021-02-01 17:10

    On my pc I need to do the following:

    @echo off
    start C:\"Program Files (x86)\VirtualDJ\virtualdj_pro.exe" 
    start C:\toolbetech\TBETECH\"Your Toolbar.exe"
    exit
    
    0 讨论(0)
  • 2021-02-01 17:13

    Now that bash is out for windows 10, if you want to access program files from bash, you can do it like so: cd /mnt/c/Program\ Files.

    0 讨论(0)
  • 2021-02-01 17:14

    use this as somethink

    "C:/Program Files (x86)/Nox/bin/nox_adb" install -r app.apk
    

    where

    "path_to_executable" commands_argument
    
    0 讨论(0)
  • 2021-02-01 17:19

    I use in my batch files - c:\progra~2\ instead of C:\Program Files (x86)\ and it works.

    0 讨论(0)
  • 2021-02-01 17:22

    While createting the bat file, you can easly avoid the space. If you want to mentioned "program files "folder in batch file.

    Do following steps:

    1. Type c: then press enter

    2. cd program files

    3. cd "choose your own folder name"

    then continue as you wish.

    This way you can create batch file and you can mention program files folder.

    0 讨论(0)
  • 2021-02-01 17:24

    Surround the script call with "", generally it's good practices to do so with filepath.

    "C:\Program Files"
    

    Although for this particular name you probably should use environment variable like this :

    "%ProgramFiles%\batch.cmd"
    

    or for 32 bits program on 64 bit windows :

    "%ProgramFiles(x86)%\batch.cmd"
    
    0 讨论(0)
提交回复
热议问题