Overclock.net › Forums › Software, Programming and Coding › Operating Systems › How to deal with file names that have spaces in Command Prompt
New Posts  All Forums:Forum Nav:

How to deal with file names that have spaces in Command Prompt - Page 2  

post #11 of 18
Yeah, HTML and other markup languages are not real languages, they are only a way of telling a page how to be formatted.
My System
(17 items)
 
  
CPUMotherboardGraphicsGraphics
AMD Phenom II X4 955  Gigabyte GA-MA790XT-UD4P Sapphire HD 6950 Sapphire HD 6950 
RAMHard DriveHard DriveOptical Drive
G-Skill Mushkin Callisto Deluxe WD Black LG Supermulti 
CoolingOSKeyboardPower
Rasa Black CPU water block. Rasa X20 pump/res c... Windows 7 Ultimate x64 Deck Legend Fire mechanical with Cherry Black s... Cooler Master Silent Pro Gold 1200W modular PSU. 
CaseMouseAudio
Cooler Master Storm Scout Logitech MX-518 Logitech Wireless headset for gaming and 100w M... 
  hide details  
My System
(17 items)
 
  
CPUMotherboardGraphicsGraphics
AMD Phenom II X4 955  Gigabyte GA-MA790XT-UD4P Sapphire HD 6950 Sapphire HD 6950 
RAMHard DriveHard DriveOptical Drive
G-Skill Mushkin Callisto Deluxe WD Black LG Supermulti 
CoolingOSKeyboardPower
Rasa Black CPU water block. Rasa X20 pump/res c... Windows 7 Ultimate x64 Deck Legend Fire mechanical with Cherry Black s... Cooler Master Silent Pro Gold 1200W modular PSU. 
CaseMouseAudio
Cooler Master Storm Scout Logitech MX-518 Logitech Wireless headset for gaming and 100w M... 
  hide details  
post #12 of 18
Enclosing the string in quotes works. The reason this is required is because terminals are designed to stop reading input at the first white space (tab, space, new line).

So to copy a file called Stupid File.zip to Stupid File2.zip, you would do:

Code:
cp "Stupid File.zip" "Stupid File2.zip"
To change to a directory, such as Program Files:

Code:
cd "Program Files"
See, Linux makes you smart
post #13 of 18
Thread Starter 
Quote:
Originally Posted by The Hundred Gunner View Post
Enclosing the string in quotes works. The reason this is required is because terminals are designed to stop reading input at the first white space (tab, space, new line).

So to copy a file called Stupid File.zip to Stupid File2.zip, you would do:

Code:
cp "Stupid File.zip" "Stupid File2.zip"
To change to a directory, such as Program Files:

Code:
cd "Program Files"
See, Linux makes you smart
That was the first method that came to mind when I ran into the problem. Unfortunately it did not work.

For some reason just typing File Name.exe worked... It didn't the first time I tried.
System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 2500k ASRock P67 Extreme4 Gen 3 AMD 7970 16GB DDR3 
Hard DriveOptical DriveOSMonitor
Intel 520 256GB SATA DVD Burner Windows 7 64 bit Deal U2410 
KeyboardPowerMouse
Adesso Mechanical Silverstone OP650 Logitech G700 
  hide details  
System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 2500k ASRock P67 Extreme4 Gen 3 AMD 7970 16GB DDR3 
Hard DriveOptical DriveOSMonitor
Intel 520 256GB SATA DVD Burner Windows 7 64 bit Deal U2410 
KeyboardPowerMouse
Adesso Mechanical Silverstone OP650 Logitech G700 
  hide details  
post #14 of 18
Quote:
Originally Posted by pauldovi View Post
That was the first method that came to mind when I ran into the problem. Unfortunately it did not work.

For some reason just typing File Name.exe worked... It didn't the first time I tried.
Interesting.
post #15 of 18
Quote:
Originally Posted by pauldovi View Post
Say I want to run "this program.exe".
I like how the answer was in his original post. If you want to run "this program.exe" then you run "this program.exe" with the quotes. The quotes must start at the start of the path and end at the end of the file extention. For example
Code:
> "my images/my viewer.exe" image1.jpg image2.jpg
will run "my images/my viewer.exe" with arguments "image1.jpg", "image2.jpg" but
Code:
> my images/my viewer.exe image1.jpg image2.jpg
will try to run my.exe (or my.com or my.bat, any of the automatic extensions) with the arguments "http://www.overclock.net/images/my", "viewer.exe", "image1.jpg", "image2.jpg".

You cannot use
Code:
> my images/"my viewer.exe"
or
Code:
> "my images/my viewer.exe image1.jpg image2.jpg"


Quote:
Originally Posted by PhillyOverclocker View Post
Yeah, HTML and other markup languages are not real languages, they are only a way of telling a page how to be formatted.
Very true (assuming by "real language" you mean something like an imperative language or a functional language), though %20 is nothing to do with HTML at all. It is part of the encoding used in URIs. + is an alternative in the URI but it also nothing to do with the HTML. 0x20 is the hexidecimal value of the ascii character for space (32). In other languages other notations are used, such as \\20. In html, it would be & #32;



On Linux you can generally either use quotation marks just as you would in windows or you can escape spaces with a \\. It depends on the shell.
Serene Power
(13 items)
 
  
CPUMotherboardGraphicsRAM
Dual Xeon E5620 Supermicro X8DAL-i EVGA 570HD SC 8GiB Corsair DDR3 1333 ECC-R 
Hard DriveOptical DriveOSMonitor
OCZ Agility 3 120GB SSD (+16TB NAS) LG 10x Blu-Ray Windows 7 x64 / Debian x64 Dell 2408WFP, P2411H 
PowerCase
850W CoolerMaster SilentPro M CoolerMaster Cosmos Pure 
  hide details  
Serene Power
(13 items)
 
  
CPUMotherboardGraphicsRAM
Dual Xeon E5620 Supermicro X8DAL-i EVGA 570HD SC 8GiB Corsair DDR3 1333 ECC-R 
Hard DriveOptical DriveOSMonitor
OCZ Agility 3 120GB SSD (+16TB NAS) LG 10x Blu-Ray Windows 7 x64 / Debian x64 Dell 2408WFP, P2411H 
PowerCase
850W CoolerMaster SilentPro M CoolerMaster Cosmos Pure 
  hide details  
post #16 of 18
Enclose the filename with double qoute. Example: c:\"tope Installer"

i use this in changing my folder attribute.

in command prompt (cmd) , i type in
c:\attrib -s -r -h "tope Installer"

Note: tope installer is a folder name. Hope this help.
post #17 of 18
open CMD,

if the file name is: "my example.exe"

type \*example.exe

* = means all with the same this "last charaters" and/or "file extension"

unless your naming is "my one example.exe" and you have another file name with "my 2nd example.exe"

then you are doomed...........
post #18 of 18
so much miss information here.

Firstly %20 isn't even HTML, it's URL encoding. It's not part of the HTML spec what so ever.
Next, you don't need double slashes within quotes (eg "c:\path to file\" is valid)
Finally, be careful about using spaces (even within quotes) as parameters as they can play havoc with some programs.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Operating Systems
This thread is locked  
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › How to deal with file names that have spaces in Command Prompt