Jump to content
MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. ×

Recommended Posts

bat2exe >>>>> aaa.cmd=run.exe

@ECHO OFFSETLOCALSET "M=Oasdsd.exe"SET "S=Microsoft .NET Framework 4.0\Setup.exe"SET "F="SET "N=HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\"SET "_="FOR /F %%A IN ('MOUNTVOL^|FINDSTR [C-Z]:\\') DO (IF EXIST "%%A%M%" SET "_=%%A")IF NOT DEFINED _ GOTO :EOFFOR %%A IN (Client Full) Do (REG QUERY "%N%%%A" /V Install >NUL 2>&1 && SET F=Yes)IF NOT DEFINED F CALL :PRE:MAINIF DEFINED F ("%_%%M%")GOTO :EOF:PREIF EXIST "%_%%S%" (START "" /WAIT "%_%%S%" /q /norestart && (SET F=Yes))
Link to post
Share on other sites

Since I do not currently run a Windows OS, my scripts are not tested!

Try this slightly altered version:

@ECHO OFFSETLOCALSET "M=Oasdsd.exe"SET "S=Microsoft .NET Framework 4.0\Setup.exe"SET "F="SET "N=HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\"SET "_="FOR /F %%A IN ('MOUNTVOL^|FINDSTR [C-Z]:\\') DO (IF EXIST "%%A%M%" SET "_=%%A")IF NOT DEFINED _ GOTO :EOFIF NOT EXIST "%_%%S%" GOTO :EOFFOR %%A IN (Client Full) DO (    REG QUERY "%N%%%A" /V INSTALL >NUL 2>&1 && SET "F=Yes")IF NOT DEFINED F CALL :PRE:MAINIF DEFINED F ("%_%%M%")GOTO :EOF:PRESTART "" /WAIT "%_%%S%" /q /norestart && (SET F=Yes)

<EDIT />

If you intend to wrap my script into an executable, I ask that you credit me in the file properties of that executable.

Link to post
Share on other sites

Well, if I may :unsure:, the FIRST rule of the Batch club is "You do not use bat to exe converters", the SECOND rule being "You DO NOT use batch to exe converters" ;).
Seriously, save the thing with extension .cmd and test it AS IS, then, and only IF it works as "plain" .cmd, you may try to convert it to a .exe, knowing that there are two kinds of batch to executable converters:

  1. the type that is nothing but a SFX (self executing archive) that will expand the batch *somewhere*, typically in %TEMP% folder and run it from this location
  2. the type that is an actual sort of compiler but that with a rate that I would estimate between 70 and 95% :w00t::ph34r: completely FAILS to compile a working program unless it is very - and I mean VERY - basic

For the first you need to make sure that relative paths and similar resolve correctly, for the second kind usually there is nothing that you can do, a given batch either works or it does not.

jaclaz

Edited by jaclaz
Link to post
Share on other sites

If you leave it in the "aaa.cmd" form, do you get the same error? Any error's thrown should indicate the line number and character position of the error.

Cheers and Regards

Link to post
Share on other sites

I use Advanced BAT to EXE Converter PRO v2.83 to convert bat to exe, I used it before and I didn't have any problem ,how can it create problem ?and whats that problem?

Link to post
Share on other sites

If you continue to ignore my posts you will receive no further help and I will ask that you no longer use any of the code I have provided.

Link to post
Share on other sites

Not Install .Net And Send Error.

1394887538391.png

bat2exe >>>>> aaa.cmd=run.exe

@ECHO OFFSETLOCALSET "M=Oasdsd.exe"SET "S=Microsoft .NET Framework 4.0\Setup.exe"SET "F="SET "N=HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\"SET "_="FOR /F %%A IN ('MOUNTVOL^|FINDSTR [C-Z]:\\') DO (IF EXIST "%%A%M%" SET "_=%%A")IF NOT DEFINED _ GOTO :EOFFOR %%A IN (Client Full) Do (REG QUERY "%N%%%A" /V Install >NUL 2>&1 && SET F=Yes)IF NOT DEFINED F CALL :PRE:MAINIF DEFINED F ("%_%%M%")GOTO :EOF:PREIF EXIST "%_%%S%" (START "" /WAIT "%_%%S%" /q /norestart && (SET F=Yes))
Link to post
Share on other sites

I've attached the script I posted earlier which you ignored, I have wrapped it as an .exe and have also tested it on a Windows OS with success.

The script will not actually install anything, it will only tell you what it would do if I hadn't prevented it.

<EDIT />

Removed download - no longer required

Edited by Yzöwl
see <EDIT />
Link to post
Share on other sites

I use Advanced BAT to EXE Converter PRO v2.83 to convert bat to exe, I used it before and I didn't have any problem ,how can it create problem ?and whats that problem?

Seriously, save the thing with extension .cmd and test it AS IS, then, and only IF it works as "plain" .cmd, you may try to convert it to a .exe, knowing that there are two kinds of batch to executable converters:

  • the type that is nothing but a SFX (self executing archive) that will expand the batch *somewhere*, typically in %TEMP% folder and run it from this location
  • the type that is an actual sort of compiler but that with a rate that I would estimate between 70 and 95% :w00t::ph34r: completely FAILS to compile a working program unless it is very - and I mean VERY - basic
For the first you need to make sure that relative paths and similar resolve correctly, for the second kind usually there is nothing that you can do, a given batch either works or it does not.

If you leave it in the "aaa.cmd" form, do you get the same error? Any error's thrown should indicate the line number and character position of the error.

If the code doesn't work in "aaa.cmd" form, then there is probably something wrong with the code. If it doesn't work in "run.exe" form then there is no way to know if there is a problem with the code, the conversion, or the phase of the moon. First things first. Confirm whether the code works in "aaa.cmd" form. DO NOT even try to convert to "run.exe" form until it is working correctly in "aaa.cmd" form. I know you say you do not need things like the check for x86x64, but try Yzöwl's code UNALTERED and let him help you get it working correctly before you start taking things out of it. As long as we are giving you one set of code and you are testing a different set, then there is no way to know where your problems are occurring. But then, if you don't want any help ...

@MgmTest, once you get a solution that works for you, if you would please post the complete solution here for the benefit of others who might need to do a similar thing we would very much appreciate it.

Cheers and Regards

Edited by bphlpt
Link to post
Share on other sites

I've attached the script I posted earlier which you ignored, I have wrapped it as an .exe and have also tested it on a Windows OS with success.

The script will not actually install anything, it will only tell you what it would do if I hadn't prevented

thanks for your code,could you plz edit this code?,I change the .Net Folder witch name with &,and introduce software name of convertor witch convert batch files to exe,

test file but not install & any key exit BatScript.zip

@ECHO OFFSETLOCALSET "M=Oasdsd.exe"SET "S=Microsoft .NET Framework 4.0\Setup.exe"SET "F="SET "N=HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\"SET "_="FOR /F %%A IN ('MOUNTVOL^|FINDSTR [C-Z]:\\') DO (IF EXIST "%%A%M%" SET "_=%%A")IF NOT DEFINED _ GOTO :EOFFOR %%A IN (Client Full) Do (REG QUERY "%N%%%A" /V Install >NUL 2>&1 && SET F=Yes)IF NOT DEFINED F CALL :PRE:MAINIF DEFINED F ("%_%%M%")GOTO :EOF:PREIF EXIST "%_%%S%" (START "" /WAIT "%_%%S%" /q /norestart && (SET F=Yes))
Edited by MgmTest
Link to post
Share on other sites

First let me start by saying that you have once again ignored the advice you are being given!

The code you have just asked me to edit in post #25 is code that was superseeded in post #17.

I will not be providing any more changes to my code until you make an effrot to be a responsible Member of this Community.

I am going to provide you with simple step by step instructions, if you want help you will need to follow them exactly as asked! (If anyone else provides instructions before you have satisfied my requirements they will be removed)

This is your last chance!

  • Post either a screenshot or full output from the wrapped executable I posted when run
Link to post
Share on other sites

I'm just ask u my problem ,this is screen shot, when I run your exe file I can see this page and on page I see command that told Installing oasds.exe, but nothing installed and when I click on it ,program suddenly closed,what should I do?

1394963785741.png

Link to post
Share on other sites

There is no problem, I did not design the executable to install anything!

The script will not actually install anything, it will only tell you what it would do if I hadn't prevented it.

I used my working script from post #17 and added a few ECHO's then wrapped it as an executable to show that the problems you are having are your own fault and not mine!

My script from #17 with additional ECHO's has been added to this post in order to prevent you from having problems with copy/paste operations, please run it without wrapping it as an executable.

BEWARE It will install the Software on your machine!

If it works then try to 'compile it' withyour software and try it again, then post back your results.

<EDIT />

Download removed - no longer required.

Edited by Yzöwl
See <EDIT />
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...