1.

Solve : BAT2EXE adding Quotes to SET statements??

Answer» GOOD morning EVERYONE, the newest VERSION of Bat_to_EXE_converter does somerthing new.

I have a bat file that has the following:

set MODULE=%3
set SERVERNAME=%4

If the file is in BAT format, the results are:

set MODULE=SY
set SERVERNAME=NULL

Once I compile the BAT file into an EXE, the results are:

set MODULE="SY"
set SERVERNAME="NULL"

This definately messes up my scripts
if {%4}=={NULL} set SERVERNAME=%COMPUTERNAME%

Any ideas on how to stop this?


Ken


i don't personally use BATtoEXE and i have heard problems associated with it. however, i do have experience in programming with other languages like Perl and Python and have used their converters (perl2exe for Perl and pyinstaller/py2exe for Python) to produce EXE files and have worked PRETTY well. If you are not RESTRICTED to batch, i recommend you pick up one of these languages and play with it. Where is the site that created the complier ( converter ) from bat to exe?
Contact their Support Department?

In the meantime try:

REM on the command line for the bat file try "%3" and "%4"

@echo off
set MODULE=%3
set SERVERNAME=%4



REM on the command line for the bat file try "%3" and "%4"

set MODULE=%3
set SERVERNAME=%4
echo Module = %MODULE%
echo Servername = %SERVERNAME%

REM Once I compile the BAT file into an EXE, the results are:

set MODULE="SY"
set SERVERNAME="NULL"

REM This definitely messes up my scripts
if {%4}=={"NULL"} set SERVERNAME=%COMPUTERNAME%
echo servername %SERVERNAME%

C:\>


Discussion

No Comment Found