Command script generate a .cmd file rather than .bat?

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

User avatar
dpupello
Member
Member
Posts: 63
Joined: 2002 Feb 14, 15:47
Location: FL

Command script generate a .cmd file rather than .bat?

Post by dpupello »

This is probably going to elicit a "RTFM" (haha), but on first glance I couldn't find the answer to this question.

Is it possible to have Xplorer2 generate a .cmd file instead of a .bat file when using the Command script function?

I thought I had read way back in the mists of time that .cmd files are more "native" for Win 2000 (read: 32bit) and that .bat files possibly call or open a 16-bit command function.

Don't know the relevance to this topic, if any, but does it make a difference if Xplorer2 is set to use the normal command console rather than the Xplorer2 console?

I happen to find the normal console snappier in response, and it also obeys the exit command ;) The Xplorer2 console is so much more powerful, but slower to close and thumbs its nose at "exit." :)

Thanks for any feedback.

Dennis
User avatar
nikos
Site Admin
Site Admin
Posts: 16401
Joined: 2002 Feb 07, 15:57
Location: UK

Post by nikos »

to be honest, i've never heard of cmd files before so i can't tell
try editing the script and save it as cmd to see if it is executed and how

console2 is meant to stick around for the duration of the program
you can "exit" by clicking on the X (close) button
but that goes against the design i had in mind
you can disable console2 altogether from Tools | Options
ckit
Silver Member
Silver Member
Posts: 269
Joined: 2004 Jun 10, 12:24

Post by ckit »

CMD files are the same as BAT files except they are executed via CMD.exe (32-bit) BAT files under NT are executed via Command.com (16-bit)
User avatar
nikos
Site Admin
Site Admin
Posts: 16401
Joined: 2002 Feb 07, 15:57
Location: UK

Post by nikos »

nice!
so it means you get access to more powerful command options
however x2 scripts usually do repetitive and simple actions so i doubt there's going to be any advantage either way

btw, console2 runs cmd.exe so batch files run through it
of course it could be that it launches another command processor behind the scenes...
User avatar
JRz
Gold Member
Gold Member
Posts: 560
Joined: 2003 Jun 10, 23:19
Location: NL

Post by JRz »

nikos wrote:[...]btw, console2 runs cmd.exe so batch files run through it
of course it could be that it launches another command processor behind the scenes...
Yep, that's what it does. To execute a .bat file it needs an instance of command.com, so cmd.exe launches an instance.

It would be nice Nikos if would generate .cmd files on platforms which support this (Win2000 and up), simply because it is quicker in execution and more 'native' to the platform. You already have a mechanism for determining which version of Windows is running under the hood I think... ;)
Dumb questions are the ones that are never asked :turn:
Robert2
Gold Member
Gold Member
Posts: 705
Joined: 2004 Jun 17, 15:39

CMD Files

Post by Robert2 »

Greetings--
Here is from http://forums.devshed.com/t142206/s.html:

"CMD.EXE passes all .BAT files to Windows NT's DOS command processor, typically COMMAND.COM, for execution (yes, there is a skeletal DOS command processor in Windows NT!). COMMAND.COM handles a few DOS-related commands, but passes most internal commands to a second copy of CMD.EXE so that they are executed in the Windows NT environment. This convoluted system allows you to load memory-resident DOS programs (TSRs), and run other programs which use them, all from the same .BAT file. However, it reduces performance for all .BAT files in order to support those rare files which load DOS TSRs under Windows NT."

Cheers
Robert
User avatar
dpupello
Member
Member
Posts: 63
Joined: 2002 Feb 14, 15:47
Location: FL

Post by dpupello »

JRz wrote:It would be nice Nikos if would generate .cmd files on platforms which support this (Win2000 and up), simply because it is quicker in execution and more 'native' to the platform. You already have a mechanism for determining which version of Windows is running under the hood I think... ;)
This is an older thread, but I'd like to second JRz's suggestion about changing the x2tmpScript.bat to x2tmpScript.cmd -- at least for Win2K and up.

Can't imagine it would be that difficult.  Other than the OS detection code, wouldn't it simply be a matter of three characters changed (bat to cmd) in the source code?  Dunno about the compiled .exe :)

If this is too low priority or Nikos says forget it, is there a simple way to change this with a Hex editor?

Thanks for any suggestions.

Dennis
User avatar
nikos
Site Admin
Site Admin
Posts: 16401
Joined: 2002 Feb 07, 15:57
Location: UK

Post by nikos »

ok i'll change this in the next version
User avatar
dpupello
Member
Member
Posts: 63
Joined: 2002 Feb 14, 15:47
Location: FL

Post by dpupello »

nikos wrote:ok i'll change this in the next version
On my version 1.2.0.0 [Unicode], comand scripts still use x2tmpScript.bat rather than x2tmpScript.cmd.

Gentlemen, we've got to protect our phony-baloney jobs!  Harumph harumph!

Nikos, was this an oversight, or did you decide not to implement?

Thank you.

Dennis
dennisfpATyahooDOTcom
User avatar
nikos
Site Admin
Site Admin
Posts: 16401
Joined: 2002 Feb 07, 15:57
Location: UK

Post by nikos »

yes, that was somewhere in there in the list but somehow didn't make it into production :)

present status = dormant