Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Variable Substitution and Spaces in Filenames

Keywords: spaces in filenames	  

Question:

I'm using winbatch to develop a document management system on Windows 95. However, when I try to edit an existing Word for Windows file which contains spaces. It treats the letters in between the spaces as a filename. e.g. File "test 1.doc", it comes up with an error saying it cannot find "test.doc" and "1.dot" Is there a solution to this problem?

Answer:

WinBatch can handle spaces in filenames. Some applications cannot, or might need special help like double quotes around the file names.

Basically Word for Windows requires double quotes to be around long file names. Try doing it at a command prompt. It gets Word for Windows to accept the long file name, you have to put double quotes around it. Notice you need to put the percent sign % around the variable when you want to retain the quotes.

        RunZoom("c:\msoffice\%AppDir%",'"%filenam%"')

Article ID:   W13461
Filename:   Spaces in Filenames.txt