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 »

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: 421
Joined: Fri Feb 13, 2004 1:05 pm

Re: Exe with Parameter

Post by support »

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

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

Post by schlawiner »

the batch takes over the variables, the exe not

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

Post by support »

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 »

How can we solve the problem to make it work

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

Post by support »

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