lots of interest
, you guys are great
yes i agree that the batch compilers leave much to be desired. hence my looking into alternate programming languages to continue my coding in.
not to hide, but the source file is getting a bit large so as a way of making it run faster. there is nothing revolutionary about my code, all it does is set the current diretory (where ever i happen to be) to an environment variable, in this case called
return.
and yes, i won't be selling my compiled wares
anytime soon. it is just basic stuff that i would like use on more than one machine on the network, be compact and run fast.
the use of
setx is so that instead of using the
set command (for the local DOS window), im setting the value for all future DOS windows (actually, after testing to make sure that
SETX is valid, i run this:
setx return %cd% & set return=%cd% The primary intent of the batch file is whether to set local or global env var's.. other than
choice (though i could use set/p),
setx is the only external file that runs in the routine. All the rest are batch related (ie rem's, labels', if's and for's)
now to the goodies:
so i put in the echo %cd% (plus lots of other stuff) to see what the compiled version showed. and certainly enuf, the echo %cd% showed as... nothing (i put in the line:
echo %%cd%% is %cd%). so during runtime, there is no apparent directory. where i did get an unexpected hit was with this line:
echo The filename will be %~n1this spit out something like this: the
filename will be CDCURRDIRCURRDIRTEMPTSTERRORLEVELTEMPTS T ╨ì╢ßC:\WINXP\SYSTEM32what i had expected was this: the filename is
C:\winxp\system32\sp, so clearly the %1 parameter for the command (just a filename is all) is undergoing changes at runtime.
but all of this is not to fix the obvious shortcomings of the compilers as what to use to do the new coding with??
im pretty good at vb, lisp and some c++, so i will take a look at what you suggest. as for quick batch compiler, im running that in trial mode (ver 3.2.9) (and the PE version im incorrect about, it looks like its just the batch compiler standard, using nem's tools)
This thread just goes to prove what I (and others) have said before, namely that batch-to-exe converters are a bad thing, and not for any serious work. The first question that comes to mind, is why bother to hide the batch script? If the answer is "to hide my code from the prying eyes of people who might want to steal my ideas", then my answer would be "If you are still at the level of batch scripting, then your ideas are almost certainly not worth stealing". Many people, when presented with an .exe file of unknown origin, wonder "what does this thing do?" If the answer from the supplier is "I'm not going to tell you, and I have deliberately hidden the code" then that is a warning sign straight away. Also the use of setx makes me wonder just what the *censored* is going on. If the motivation is to make something that looks "professional" then just dressing a batch file up with a wrapper is not going to do this. There are plenty of compiled languages which are free and can make exes. C, C++, FreeBasic, there are a ton of them. Even Auto-It can make an exe file. If you want to make a proper program, put in the effort with a proper language.
Now to some specifics: all that most batch-to-exe converters do is create a self-extractor that spits out the original batch file into a convenient folder (usually the current user's temp folder) and then runs it from there. Therefore anything that expects to find folders and files that are defined as relative to the .exe file or its folder is not going to work. Secondly, some of those converters are for MS-DOS which is not the same as Windows NT family command prompt. I notice that Quick Batch Compiler is payware, so did you pay for this or is a cracked version? BatLite is MS-DOS only. So is bat2exec. Batch File Compiler PE is payware, so again did you crack it? (You sure have listed a lot of payware there!) Batch Compiler v3.1.2 needs a runtime: .NET Framework v1.1. The "compiler" is written in C# .NET and as such requires the .NET runtime to run. Bat to Exe Converter is free, exescript is payware, so is powerbatch. Batlite and Bat2Exec produce 16-bit .com executables which will not run on 64 bit operating systems.