ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Windows Batchfile can't recognize long file name...!!!!

(1/5) > >>

hulkbuster:
Hello folks,
        can anyone provide an answer to these questions, lately i have made few batch file to open portable application and folders, really saves one's bell and i made few winrar files but after playing with it, i realized these batch file would not work for files and folders having spaces and lots of dot between them. Let me give an example:-
       
1.C:\Program Files\Bulk Rename Utility
2.F:\MY SOFTWARE\INSTALL\Microsoft .NET Framework 4.0.30319.zip
3.F:\MY SOFTWARE\INSTALL\Zortam Mp3 Media Studio PORTABLE 14.45.rar     
4.F:\MY SOFTWARE\INSTALL\Auslogics Disk Defrag Professional\diskdefrag.exe


Now Windows batch file would not recognise these type of folders, nor can it open files( of portable application ) with spaces and it can't compress too. Why???
Is their any way round to go about these problem, or do i need to use certain third party software to open or compress these files and folders.
The error i get is:
Windows cannot find
f:\software\Auslogics Disk Defrag Professional\diskdefrag.exe . Make sure you typed the name correctly, and then try again.
--- End quote ---

So these are the directory structure, the default commands like cd,start, md would not work???

Any suggestion is greatly welcomed.

AndyM:
Have you tried surrounding the complete path and filename in quotes?

"C:\Program Files\Bulk Rename Utility"

hulkbuster:
i think i tried that, and i have to recheck that again.

f0dder:
As AndyM says, you need quotes around paths that contain spaces - otherwise, the path C:\Program Files\Bulk Rename Utility will be interpreted as launching the program C:\Program Files\Bulk with the two arguments Rename and Utility. It's pretty easy if you can use the full path in your batch files - simply add quotes around the path.

The following all work:
1) "r:\spacy path\fancy program\passwords.exe"
2) "r:\spacy path\fancy program"\passwords.exe
3) "r:\spacy path"\"fancy program\passwords.exe"
4) "r:\spacy path"\"fancy program"\passwords.exe
5) "r:\spacy path"\"fancy program"\"passwords.exe"

...if you have a common "x:\path with spaces" path, perhaps take a look at environment variables ("set /?" in a command prompt).

rjbull:
If you need to use quote marks, it's possible you may also need to add a widow "title", else Windows can get confused.  If you have problems with a command prompt opening for the batch file, and then hanging, it may help to review this short DC thread: Starting CHS via batch file quandary

Navigation

[0] Message Index

[#] Next page

Go to full version