windows - Embed a .exe file into a .bat file and auto copy to a desired location -


i using curl.exe file in batch file problem users should not know mechanism using pull , display data website.

now how working: have place curl.exe file under c:\ batch file use connect wan server , pull data.

what expecting: need merge / attach curl.exe batch file user don't have copy curl file c:\ location batch execute.

finally converting batch file exe, there way can merge curl.exe , my.bat file , copy curl.exe desired location?

many thanks...

you can following (based on answer here):

create 1 file batchbin.bat following contents:

;;;===,,,@echo off ;;;===,,,echo here ;;;===,,,findstr /v "^;;;===,,," "%~f0" > curlextracted.exe ;;;===,,,echo can add code here ;;;===,,,curlextracted.exe example.com ;;;===,,,echo can add code until here ;;;===,,,exit /b 

very important: after exit /b press enter in order create newline otherwise won't quite work.

then run following command (assuming have curl.exe , batchbin.exe in current working directory):

copy /a batchbin.bat + /b curl.exe /b combined.bat

then ship combined.bat file client, run it, , it'll extract file called curlextracted.exe (of course can change name in script) current working directory (you can change location, if want use other path). version of script tests curl getting example.com, you can see works..


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -