[SOLVED] having problems with spaces in file/folder name with 'for' command
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
having problems with spaces in file/folder name with 'for' command
hi all i'm trying to use the 'for' command along with 'move' to help move all .rar files from one folder to another but some files have spaces and don't get moved as the spaces break the script
i've tried adding " to the folder path but that didn't work any ideas?
this is what i have so far:
Code:
for /F %%f in ("F:\old\*.rar") do move "%%f" "F:\new\"
Well that would be the usual story of you now adding further detail which changes the question, but now you have a working solution?
no no working solution yet.. that command still fails with spaces in the name i just posted my full command as others were suggesting to just use the 'move' command
Last edited by steve51184; 07-11-2012 at 08:49 AM.
Not having played with batch files for a while, much like syg00, I would point out that ntubski is using single % signs and has an @ in front of if.
Maybe these are the missing items?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.