Could not touch file when specify full path in Cygwin in .bat file
Mon Jun 12 19:30:00 GMT 2006

Hi, Cygwin support group,

I have problem to touch a file when specify the full path. Here are some examples. MKS works fine

-- Filename with special characters
D:\>touch D:\usr\meta\boxster\UNITw2kMixednew\boxster_UNITw2kMixednew_0205\Tree\!@#$%&()_+.!@#$%&()_+
) was unexpected at this time.

-- With the quote on filename
D:\>touch D:\usr\meta\boxster\UNITw2kMixednew\boxster_UNITw2kMixednew_0205\Tree\"!@#$%&()_+.!@#$%&()_+"

touch: cannot touch `D:\\usr\\meta\\boxster\\UNITw2kMixednew\\boxster_UNITw2kMixednew_0205\\Tree\\!@#$%&()_+.!@#$%&()_+': No such file or directory

-- We can touch a file with the double quota in DOS cmd window.
D:\>touch  "D:\usr\meta\boxster\boxster_UNITw2kMixednew\boxster_UNITw2kMixednew_0205\Tree\!@#$%()_+.!@#$%&()_+"



--- If we put this touch command in windows batch file -- (clone.bat) file, it won't work.

SET TEST_SERVER=D:\usr\meta\boxster\UNITw2kMixednew\boxster_UNITw2kMixednew_0205\Tree
touch "%TEST_SERVER%\!@#$%%^&()_+.!@#$%%^&()_+"                     <== (we try touch without quote, same result)

--- run .bat file
D:\usr\meta\boxster\boxster_UNITw2kMixednew\boxster_UNITw2kMixednew_0205>cmd /c clone.bat
touch: cannot touch `D:\\usr\\meta\\boxster\\UNITw2kMixednew\\boxster_UNITw2kMixednew_0205\\Tree\\!@#$%^&()_+.!@#$%^&()_+': No such file or directory

Do you know why is that and how do we make it work in .bat file?

Thanks a lot for your help!


Where Information Lives
Xiaomin Wu
Phone#: 508-305-8783
Ext: 48783

Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list