Exe with Parameter

Convert your BATch files into EXEcutable format in one click.
Post Reply
schlawiner
Posts: 3
Joined: Thu Nov 05, 2015 8:00 am

Exe with Parameter

Post by schlawiner » Sat Nov 14, 2015 1:28 am

How to create an exe, to accept what parameters



the batch accepts the parameters so

Code: Select all

@echo off
SET var=%~dp0
SET var1=%1%
SET var2=%2%
SET var3=%3%
SET var4=%4%
SET var5=%5%
SET var6=%6%
SET var7=%7%
as soon as I want to compile it into an exe, does not work

please give me an example

support
Site Admin
Posts: 402
Joined: Fri Feb 13, 2004 1:05 pm

Re: Exe with Parameter

Post by support » Thu Nov 26, 2015 8:13 am

what exactly doesn't work?
variable return wrong result?

schlawiner
Posts: 3
Joined: Thu Nov 05, 2015 8:00 am

Post by schlawiner » Tue Dec 08, 2015 11:50 pm

the batch takes over the variables, the exe not

support
Site Admin
Posts: 402
Joined: Fri Feb 13, 2004 1:05 pm

Post by support » Wed Dec 09, 2015 5:25 am

If you CALL compiled file from another application then all variables will be lost.
All batch scripts executed in the single process, EXE files - independed processes.

schlawiner
Posts: 3
Joined: Thu Nov 05, 2015 8:00 am

Post by schlawiner » Mon Dec 14, 2015 2:01 am

How can we solve the problem to make it work

support
Site Admin
Posts: 402
Joined: Fri Feb 13, 2004 1:05 pm

Post by support » Tue Jan 26, 2016 1:39 am

Have you used this valiables in the same script?
Add echo commands for debugging.

For me, this script work correct after compilation:

SET var1=%1%
ECHO %var1%

Post Reply