View Single Post
  #21  
Old 19-07-2020, 15:38
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,749
Thanks: 2,170
Thanked 11,206 Times in 2,307 Posts
Razor12911 is on a distinguished road
Quote:
Originally Posted by BLACKFIRE69 View Post
Code:
@echo off

set /p num=Enter output archive name: 
set/p comp= Enter Compression Method: 

set "InputDir=%~dp0In"
set "OutputDir=%~dp0Out"

cd /d "C:\Users\BLACKFIRE69\Downloads\Compressed\Test\Binaries"

arc.exe a -ep1 -dses --dirs -s; -lc- -di -i2 -r -w.\Temp -m%comp% "%OutputDir%\MASQUERADE-Data_%num%.MSQ" "%InputDir%\%num%\*"

pause&exit
I think you made cls without considering that Current directory can change, simple fix is the usage of SetCurrentDir function when your cls launches like this

SetCurrentDir(ExtractFilePath(GetModuleName));

where GetModuleName is
Code:
function GetModuleName: string;
var
  szFileName: array [0 .. MAX_PATH] of char;
begin
  FillChar(szFileName, sizeof(szFileName), #0);
  GetModuleFileName(hInstance, szFileName, MAX_PATH);
  Result := szFileName;
end;
A better fix is directly execute every single exe file with full paths and set the work directory too
Reply With Quote
The Following 2 Users Say Thank You to Razor12911 For This Useful Post:
BLACKFIRE69 (19-07-2020), L0v3craft (20-07-2020)