How do I open files which are located in a folder with spaces in the folder name like
C:\This Is Just A Folder Name\
nconvert commands -D C:\This Is Just A Folder Name\*.tiff doesn't work.
nconvert commands -D "C:\This Is Just A Folder Name\"*.tiff doesn't work either.
I use a batch file for this.
Or is there a special way for typing the spaces in the batch file?
folder name with spaces
Moderators: helmut, XnTriq, xnview
Re: folder name with spaces
Entering dir /x at the command prompt should give you the 8.3 short filename notation.
- Microsoft Knowledge Base: How Windows Generates 8.3 File Names from Long File Names
- Microsoft TechNet Library: Command-line reference » Dir / For
- Ninotech: Path Copy
- CodePlex: Path Copy Copy
- PLJ Soft: ClipName
-
- Posts: 20
- Joined: Mon Apr 30, 2012 10:32 pm
Re: folder name with spaces
That with dir /x worked. Thanks!
(That with the help-programs goes in a direction I'm not interested in.)
as an example:
instead of
-D C:\PICTURES\portable stuff\%image folder%\nightly\-77577-\
I now use
-D C:\PICTURES\PORTAB~1\%%IMAGE~2\nightly\-77577-\*.*
and that works.
But I'm still wondering why I have to use the second %.
It's like
-out jpeg -o C:\PICTURES\developed\%%.jpg
which also didn't work (properly) without the second %.
(At least I missed the point there this behaviour is documented.)
(That with the help-programs goes in a direction I'm not interested in.)
as an example:
instead of
-D C:\PICTURES\portable stuff\%image folder%\nightly\-77577-\
I now use
-D C:\PICTURES\PORTAB~1\%%IMAGE~2\nightly\-77577-\*.*
and that works.
But I'm still wondering why I have to use the second %.
It's like
-out jpeg -o C:\PICTURES\developed\%%.jpg
which also didn't work (properly) without the second %.
(At least I missed the point there this behaviour is documented.)
Re: folder name with spaces
Please try the following syntax:unquestioned2 wrote:nconvert commands -D "C:\This Is Just A Folder Name\"*.tiff doesn't work either.
- nconvert commands -D "C:\This Is Just A Folder Name\*.tiff"
unquestioned2 wrote:But I'm still wondering why I have to use the second %.
It's like
-out jpeg -o C:\PICTURES\developed\%%.jpg
which also didn't work (properly) without the second %.
(At least I missed the point there this behaviour is documented.)
- XnView Forum: bugs and suggestions for NConvert
- Microsoft: Windows XP Professional Product Documentation » Using batch parameters
- SS64: Windows CMD » Syntax » Quotes, Escape Characters, Delimiters
- Rob van der Woude's Scripting Pages: Escape Characters
- Richard Bonner: DOS Characters » Percent Percent or Double Percent
Related topics for future reference:
- basic help please...
- Spaces in filename or filename path
- BATCH file doesn't work
- nconvert and unc-paths?
- Use Of Wildcards
- Problem - spaces and wildcards in parameters
- Error output folder name
- batch .EMF > 200% > .JPG ?
- file name with space
xnview ([url=http://newsgroup.xnview.com/viewtopic.php?t=44&p=182#p182]nconvert syntax: .ico to .bmp?[/url]) wrote:Yes, use " ("my folder"Guidance wrote:BTW, does nconvert support quotes if the path contains spaces?
xnview ([url=http://newsgroup.xnview.com/viewtopic.php?t=15383&p=63475#p63475]Batch-convert single tiffs to multipage tiffs...[/url]) wrote:And yes, if filename or folder have a space, there is a problemfirestar77 wrote:Do you have tried
for /D %i in (*) do nconvert -multi -out tiff -o %i.tif %i\*.tif
Andys ([url=http://newsgroup.xnview.com/viewtopic.php?t=5196&p=62814#p62814]Conversion with subfolders[/url]) wrote:For me, previous sample didn't work when there were spaces in dir names.
Here's an update -
@for /R /D %%a in (*) do nconvert.exe <your_options_here> %%~sa\*.*
~s is a documented 'for' feature, it converts to short path
-
- Posts: 20
- Joined: Mon Apr 30, 2012 10:32 pm
Re: folder name with spaces
I didn't mention it, but I'd tried that already and it didn't work - if I remember me correctly.XnTriq wrote: Please try the following syntax:
- nconvert commands -D "C:\This Is Just A Folder Name\*.tiff"
The additional links seem... are... I don't know. Similar or related to the topic. Nothing more, nothing less.XnTriq wrote: Related topics for future reference:
...
After all I hoped for another solution. For example in HTML there is difference between ENTER and
SHIFT + ENTER. The first adds an additional (empty) line and the second only ends the line as in Word.
I can imagine that there is a solution with ALT GR. Normaly it's possible to enter additional symbols
with ALT GR + a number, e.g. "123". I hoped that there was an additional symbol for SPACE,
which could be used instead of the common SPACE (by pressing the SPACE-Key) in batch-files.
Has anyone heard of something like this?
"dir /x" works. But if there is something as I mentioned, I would prefer it (because it can be used
in more situations).
Re: folder name with spaces
Well, you heard the man:
xnview ([url=http://newsgroup.xnview.com/viewtopic.php?p=98535#p98535]Problem - spaces and wildcards in parameters[/url]) wrote:Ok, so here the only way is to use a bat command + for
- Windows IT Pro
- Stack Overflow
- Google Answers
- VB Helper
- Rob van der Woude's Scripting Pages
SS64 (Windows CMD » Syntax » [url=http://www.ss64.com/nt/syntax-args.html]Parameters / Arguments[/url]) wrote:Note on short file/folder names:
There is a bug involving the ~s option - the displayed output may be wrong if the current directory name is not the same as the short (8.3) name of the directory.
A workaround is to run command.com /c rem which will change the current directory to 8.3, details here.