dallas page

Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору tavria2 благодарю, но не подходит в моем случае. В моем коде заранее не известны путь к архиву и путь к конечной папке. Они записываются в переменную. И в итоге строка получается не... "C:\Users\User\Documents\AutoPlay Media Studio 8\Projects\7zip\CD_Root\AutoPlay\Docs\7-zip\x64\7zG.exe" x "C:\Users\User\Desktop\UltraISOPortable.7z" -o"C:\Users\User\Desktop\Новая папка (3)" -y -x![] а... ""..my7zip.."" x ""..result[1].."" -o""..result2.."" -y -x![]* т.е., переменные записались просто как текст. Код: result = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "All Files (*.*)|*.*|", "", "dat", false, true); result2 = Dialog.FolderBrowse("Please select a folder:", ""); b64Bit = System.Is64BitOS(); if b64Bit then my7zip = _SourceFolder .. "\\AutoPlay\\Docs\\7-zip\\x64\\7zG.exe" else my7zip = _SourceFolder .. "\\AutoPlay\\Docs\\7-zip\\x86\\7zG.exe" end myarch = [[""..my7zip.."" x ""..result[1].."" -o""..result2.."" -y -x![]*]]; Dialog.Message("Notice", myarch, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); File.Run(myarch, "", "", SW_SHOWNORMAL, true); Dialog.Message("Notice", "ОК!!!", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); | Добавлено: Вопрос снят!!! Решил сделать так: Код: result = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "All Files (*.*)|*.*|", "", "dat", false, true); result2 = Dialog.FolderBrowse("Please select a folder:", ""); b64Bit = System.Is64BitOS(); if b64Bit then my7zip = _SourceFolder .. "\\AutoPlay\\Docs\\7-zip\\x64\\7zG.exe" else my7zip = _SourceFolder .. "\\AutoPlay\\Docs\\7-zip\\x86\\7zG.exe" end TextFile.WriteFromString("C:\\1.txt", '"', false); TextFile.WriteFromString("C:\\1.txt", ""..my7zip.."", true); TextFile.WriteFromString("C:\\1.txt", '"', true); TextFile.WriteFromString("C:\\1.txt", " x ", true); TextFile.WriteFromString("C:\\1.txt", '"', true); TextFile.WriteFromString("C:\\1.txt", ""..result[1].."", true); TextFile.WriteFromString("C:\\1.txt", '"', true); TextFile.WriteFromString("C:\\1.txt", " -o", true); TextFile.WriteFromString("C:\\1.txt", '"', true); TextFile.WriteFromString("C:\\1.txt", ""..result2.."", true); TextFile.WriteFromString("C:\\1.txt", '"', true); TextFile.WriteFromString("C:\\1.txt", ' -y -x![]*', true); myarch = TextFile.ReadToString("C:\\1.txt"); File.Run(myarch, "", "", SW_SHOWNORMAL, true); error = Application.GetLastError(); if (error ~= 0) then Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1); else Dialog.Message("Notice", "ОК!!!", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); end |
|