R
If you're lynching from BATreep, try to use it. https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/percent.mspx?mfr=true : %~s1For example:rem link.bat
masm32\bin\link.exe /SUBSYSTEM:CONSOLE %~s1
(if you call him like link.bat "D:\Новая папка\YandexDisk\asm.code.obj")If you're calling C#, try to translate the file's name into a short version on your own. This is done:[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern uint GetShortPathName(string path, StringBuilder shortPathBuf, uint bufSize);
public static string ToShortPathName(string longName)
{
// запрашиваем желаемый размер буфера
uint bufferSize = GetShortPathName(longName, null, 0);
while (true)
{
var shortNameBuffer = new StringBuilder((int)bufferSize);
// проверяем, подошёл ли буфер (избегаем race condition с внешним миром)
uint result = GetShortPathName(longName, shortNameBuffer, bufferSize);
// ошибка -> исключение
if (result == 0)
throw new Win32Exception(Marshal.GetLastWin32Error());
// хватило места -- хорошо
if (result <= bufferSize)
return shortNameBuffer.ToString();
// нет -- идём на следующий круг
bufferSize = result;
}
}