[DOS] Recognize paths with spaces ?

  • Thread starter pasc
  • Start date
  • Views 913
  • Replies 2
P

pasc

Guest
OP
Well the problem is as following:

I have a script that must handle paths with spaces in them.

I know that putting quotation marks around said path's works in some "rare" cases , however the path I have for example looks liket this:

C:\Path to\extremely long and unwinding\file.png

Any ideas ? (I swear there was a way to put something on top of a DOS batch file to make it recognize spaces in file paths/names afterwards...
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
I have had issues with things needing flags and piping in certain arrangements when it comes to using quotes if I am going to call a distant executable but quotes are an accepted part of DOS command generation. This is mainly as windows style command line is not quite so robust as unix style ones but that is a different discussion assuming I do not say something like have you considered cygwin for this?

Cheating bastard method- add the "C:\Path to\extremely long and unwinding\" directory to your path, in Windows/MS style DOS the temporary version is SET ( http://www.ats.ucla.edu/stat/hlm/path.htm ).
 
P

pasc

Guest
OP
The problem is I need this to work with variable paths:

Code:
@echo off
SET /P path=Drag and Drop the folder containing the files that should be analyzed for dup(licate) files:
dupf.exe "%path%"
> dup.txt
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    S @ salazarcosplay: show him fighting in ww2