[DOS] Recognize paths with spaces ?

Discussion in 'Computer Programming, Emulation, and Game Modding' started by pasc, Mar 9, 2013.

Mar 9, 2013
  1. pasc
    OP

    Member pasc GBATemps official GBA Freak

    Joined:
    Sep 9, 2006
    Messages:
    2,570
    Location:
    Germany
    Country:
    Germany
    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...
     
  2. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,697
    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 ).
     
  3. pasc
    OP

    Member pasc GBATemps official GBA Freak

    Joined:
    Sep 9, 2006
    Messages:
    2,570
    Location:
    Germany
    Country:
    Germany
    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
     

Share This Page