Manage Space in Command Name

Q

How to manage space characters in the command name?

✍: FYIcenter.com

A

If the command you want to run is an executable program and the program name or path has space characters, you have to enclose the command name between a pair of double quotes.

For example, if you want to run the "7z.exe" program located in the "\Program Files\7-Zip" folder, you need to enclose the path name (the folder and the file name) of the "7z.exe" program in double quotes as the command name:

C:\fyicenter>"\Program Files\7-Zip\7z.exe" i | more

7-Zip [64] 16.04 : Copyright (c) 1999-2016 Igor Pavlov : 2016-10-04


Libs:
 0  C:\Program Files\7-Zip\7z.dll

Formats:
 0               APM      apm           E R
 0               Ar       ar a deb lib  ! < a r c h > 0A
 0               Arj      arj           ` EA
 0 CK            bzip2    bz2 bzip2 tbz2 (.tar) tbz (.tar) B Z h
 0               Compound msi msp doc xls ppt D0 CF 11 E0 A1 B1 1A E1
 0      M        Cpio     cpio          0 7 0 7 0  ||  C7 q  ||  q C7
 0               CramFS   cramfs        offset=16 C o m p r e s s e d 20 R O M F
 S
 0       G  B    Dmg      dmg           k o l y 00 00 00 04 00 00 02 00
 0           E   ELF      elf           ⌂ E L F
 0               Ext      ext ext2 ext3 ext4 img offset=1080 S EF
 0               FAT      fat img       offset=510 U AA
 0               FLV      flv           F L V 01
 0 CK            gzip     gz gzip tgz (.tar) tpz (.tar) 1F 8B 08
 0               GPT      gpt mbr       offset=512 E F I 20 P A R T 00 00 01 00
 0      M        HFS      hfs hfsx      offset=1024 H + 00 04  ||  H X 00 05
-- More  --

 

Manage Space in Command Option

Basic Structure of Windows Command

Windows Command Syntax

⇑⇑ Windows Batch File Tutorials

2022-01-16, 3246🔥, 1💬