Last active
January 4, 2018 13:50
-
-
Save gjasny/74f311f3ffbdc1c6cfea1df26a38782d to your computer and use it in GitHub Desktop.
cl.exe long file name issues
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
SET WORKDIR=C:\Temp | |
::SET DIR=short | |
:: 64 + 64 + 64 + 64 | |
SET DIR=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd | |
CD /D %WORKDIR% | |
MKDIR %DIR% | |
ECHO.>foo.cpp | |
ECHO Test 1 - use very long file name on command line | |
cl.exe /c /Fo%DIR%\foo1.o foo.cpp | |
ECHO Test 2 - use UNC file name on command line | |
cl.exe /c /Fo\\?\%WORKDIR%\%DIR%\foo2.o foo.cpp | |
ECHO Test 3 - use response file with regular file | |
ECHO /c /Fo%DIR%\foo3.o foo.cpp>resp3.txt | |
cl.exe @resp3.txt | |
ECHO Test 4 - use response file with UNC file name | |
ECHO /c /Fo\\?\%WORKDIR%\%DIR%\foo4.o foo.cpp>resp4.txt | |
cl.exe @resp4.txt |
Author
gjasny
commented
Jan 4, 2018
PS V:\> Get-Item -Path Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
Hive: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
Name Property
---- --------
...
LongPathsEnabled : 1
...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment