Slashdot Mirror


For Automated Testing, Better Alternatives To DOS Batch Files?

An anonymous reader writes "I am working on a project that would allow our customers to test out sending different PCL commands to LAN printers. My initial thought was that a DOS batch file will allow users to select some simple options, send the tests to printers, and even generate a small web page which, when launched from the batch file, will provide email feedback on the tool. This all worked. To spice it up I added some ANSI color commands to the menus, though the implementation of that may prove tricky without resorting to .COM files or forcing the load of the ansi.sys via the command.com shortcut. And this implementation goes against my initial idea that I want the entire thing to be contained in a standalone batch file. My questions are: Is there a better option for this? Are DOS Batch files too 1990s to be taken seriously in 2010? The application needs to (1) be simple (2) be easy to update (3) be able to send PCL commands to LAN-attached printers and (4) allow email feedback. I don't know what other programming language would allow this and be as simple. I tend to think that I have found the best tool for the job but if you have another idea let me know. Call me crazy but I love DOS."

426 comments

  1. DOS Is dead use visual basic by Joe+The+Dragon · · Score: 5, Funny

    DOS Is dead use visual basic

    1. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 5, Funny

      DOS is dead, and no-one cares
      If there is a shell, I'll see you there

    2. Re:DOS Is dead use visual basic by Monkeedude1212 · · Score: 2, Insightful

      Yeah. VB, C++, Java, they all do PCL commands.

      Easiest way is to Build yourself a Win32 GUI, since thats what your users probably use already.

    3. Re:DOS Is dead use visual basic by game+kid · · Score: 5, Funny

      Visual Basic sucks. Get Firefox instead.

      --
      You can hold down the "B" button for continuous firing.
    4. Re:DOS Is dead use visual basic by v1 · · Score: 4, Informative

      +1 agree. VB is RAD (rapid application development), is very flexible, and is easy to use to make standalone apps. if you like programming in dos, you will love VB. For the use you are suggesting, it sounds ideal. you can basically have it be the gui front end for things you need to be done in dos (via vb, you don't need a folder full of com files for it to use)

      --
      I work for the Department of Redundancy Department.
    5. Re:DOS Is dead use visual basic by codepunk · · Score: 2, Interesting

      No but now your folder of com files will require a butt load of runtime files on every single workstation. Now personally I would smack it out as a stand alone executable in delphi, but that is just me.

      --


      Got Code?
    6. Re:DOS Is dead use visual basic by buchner.johannes · · Score: 5, Insightful

      It is important to know your alternatives (e.g. you have many scripting options through cygwin, python, perl), but:
      Use whatever works for you, and don't be ashamed just because it is not the current trend. You know your requirements (easy to maintain). Don't believe the people that say you have to rewrite everything.

      --
      NB: The message above might reflect my opinion right now, but not necessarily tomorrow or next year.
    7. Re:DOS Is dead use visual basic by i.r.id10t · · Score: 3, Funny

      I agree, if you are stuck on ms stuff then VB becomes your "shell scripting" language of quickness.

      This being /. though, I'll have to mention a small customized LiveCD (think DSL sized) with a (perl script | python script | brainfuck implementation | emacs extension | vi/vim script | whatever) with i/o to the user being prettified by some shell/exec stuff with zenity or by developing a graphical app using qt/gtk/whatever. Distribute as a business card cd or a bootable usb key. Have the marketing dept come up with some video, etc. to put on it, make it a bigger CD.

      --
      Don't blame me, I voted for Kodos
    8. Re:DOS Is dead use visual basic by Homr+Zodyssey · · Score: 4, Informative

      I often write stuff like this using javascript or vbscript, and run it with "cscript". Its included in WinXP and later, so there's no installation required -- just a js or vbs script file. So, it would function much like your Batch file but you'd have a more descriptive language to work with.

      I do think vbscript is da debbil. However, it does have its uses when it comes to interacting with Office documents.

    9. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 5, Funny

      Rebooting your computer into another OS to test a printer?

      Do you meatbags SEE why you're not commercially viable as developers?

    10. Re:DOS Is dead use visual basic by Bigjeff5 · · Score: 4, Insightful

      They're also all a thousand times more complex than DOS.

      Even simple VB Script is significantly more complicated than DOS batch files.

      My advice? If it's internal to the company and only a few users are going to use it, a batch file is fine. If you're selling it, or a lot of people are going to be using it frequently, take the time to write a simple VB app to do the job. Something like this is so easy it would only take you an afternoon to do even if you've never used VB before, and it will look a much more professional.

      If you want to just make a more professional looking wrapper for it, you can use shell commands in a VB app and not waste any of your work in the DOS script.

      --
      Security is mostly a superstition... Avoiding danger is no safer in the long run than outright exposure. - Helen Keller
    11. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 3, Insightful

      4.3
      A master was explaining the nature of Tao of to one of his novices. “The Tao is embodied in all software – regardless of how insignificant,” said the master.
      “Is the Tao in a hand-held calculator?” asked the novice.
      “It is,” came the reply.
      “Is the Tao in a video game?” continued the novice.
      “It is even in a video game,” said the master.
      “And is the Tao in the DOS for a personal computer?”
      The master coughed and shifted his position slightly. “The lesson is over for today,” he said.

      From The Tao of programming – Chapter 4: Coding

    12. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 0

      nice post.. haven't though about NIN in a while... Thanks

    13. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 0

      The only thing better than a DOS batch file is a *nix shell script!

    14. Re:DOS Is dead use visual basic by BikeHelmet · · Score: 3, Insightful

      There's nothing wrong with cmd files. Some very advanced things are built using them.

      HFslip - hotfix slipstreamer.

      BATCH is a good quick&dirty tool, for quick&dirty jobs. Right now I'm using cmd files to manage cmdline folding clients. They're installed as services, but they start up faster than everything else, and then slow down other stuff loading. Now, thanks to my quick and dirty batch scripting, they get started after everything else. (on XP) With a single command I can toggle them off so they don't come on after a reboot, which is handy if I was rebooting to play a game.

      I considered using Java, but it's just not worth the time. It took 2 minutes to write the first script in batch, and less than 20 minutes to refine it.

    15. Re:DOS Is dead use visual basic by SpectreBlofeld · · Score: 4, Insightful

      It sounds to me like the current implementation is not only effective and clever, but is (Windows) version-independent, and doesn't require any installation of third-party tools or utilities.

      Dude, you've created the Holy Grail of software. Why are you looking for alternatives?

    16. Re:DOS Is dead use visual basic by Provocateur · · Score: 1

      Heck it might even be featured in a movie:

      "Short and simple, it issues commands to these printers. WTF...DOS?!! I know this!!"

      --
      WARNING: Smartphones have side effects--most of them undocumented.
    17. Re:DOS Is dead use visual basic by JustinRLynn · · Score: 1

      I doubt it. They're too busy producing things that "just work just about all the time" instead of "barely work but they meet the spec".

    18. Re:DOS Is dead use visual basic by jetole · · Score: 1, Funny

      While I agree that visual basic sucks ...what the hell does that have to do with Firefox. Thats like saying Chevy cars suck. Get a Android cell phone instead. You just compared a programming language to a web browser.

    19. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 0

      Visual Basic is dead use Delphi.

      Er ... Delphi is dead. Sorry. So use Lazarus.

    20. Re:DOS Is dead use visual basic by dhalgren · · Score: 2, Funny

      *whoosh*

    21. Re:DOS Is dead use visual basic by Funnnny · · Score: 0

      Yeah I think you should build a GUI Interface using Visual Basic to see if you can track the IP address...oh wait

    22. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 0

      This is BY FAR the coolest thing I've read this month! I love the pun/reference!

    23. Re:DOS Is dead use visual basic by Z00L00K · · Score: 1

      I would say that whatever method that works for you is fine.

      The important thing is not really the engine to do it but that it works. And DOS batch files - they do work, but can be a bitch to read for someone not familiar with them. One nice help is using an editor like Vim that color-codes the BAT file code.

      But for testing - scripts are actually good since it means that you can correct any defects in the testing procedure fast. If the script language is DCL, BAT files, Bourne shell scripts, Perl or Python doesn't matter, just use what's suitable.

      --
      If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
    24. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 0

      Visual Basic sucks. Get Firefox instead.

      Though i am Pro Firefox, that sentence is just silly.

    25. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 0

      umm... how does firefox relate to VB?

    26. Re:DOS Is dead use visual basic by khakipuce · · Score: 1

      Bound to get shouted down on here but use an Excel macro (assuming your users have office installed). I know it may feel abit wierd but it gives you a shed load of stuff (saving, loading, etc) for free, the users know how to use it, you have no executables to deploy - just put the file/template in a shared folder and the macro language is pretty much VB.

      You can even use a VBA macro to call a batch file, so anything you can't do with VBA, can be in a batch file with a VBA front end.

      --
      Art is the mathematics of emotion
    27. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 0

      You must be an american. That was a joke.

    28. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 0

      visual basic is almost dead use phyton instead

    29. Re:DOS Is dead use visual basic by simoncpu+was+here · · Score: 1

      DOS may be dead, but its progeny lives on inside embedded devices...

    30. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 0

      I wanna fsck you like an animal.

    31. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 0

      Heresy!

    32. Re:DOS Is dead use visual basic by NetServices · · Score: 1

      If it works, don't knock it. DOS rocks!

    33. Re:DOS Is dead use visual basic by L4t3r4lu5 · · Score: 1

      I was going go go with "Fsck you like a RAID array" but didn't know if one does fsck a raid array, or use some special on-card solution for disk checking.

      --
      Finally had enough. Come see us over at https://soylentnews.org/
    34. Re:DOS Is dead use visual basic by vtcodger · · Score: 2, Insightful

      ***I would say that whatever method that works for you is fine.***

      Absolutely. Provided that the numerous peculiarities of Microsoft's command language aren't an issue (will the users ever see the inards?), and you don't have to support Unix, why would anyone not use a scripting tool that requires no additional run time be installed?

      --
      You can't see ANYTHING from a car, You've got to get out of the goddamned contraption and walk...Edward Abbey
    35. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 1, Funny

      just downloaded FireFox now, how do i add a new project again? ROFLMAO!

    36. Re:DOS Is dead use visual basic by PsychoSlashDot · · Score: 1

      No but now your folder of com files will require a butt load of runtime files on every single workstation. Now personally I would smack it out as a stand alone executable in delphi, but that is just me.

      Those runtimes are now called "The .NET Framework". They're hardly rare, exotic, or hard to distribute.

      --
      "Oh no... he found the .sig setting."
    37. Re:DOS Is dead use visual basic by Lumpy · · Score: 2, Insightful

      Have you looked at VB.net or C#.net?

      It's not simple anymore. VB6 was the last "simple" vb.

      Honestly, he should just jump to a real language as it will take the same amount of effort to get up to speed in C++ as it does to get up to speed in a inferior language like VB.net

      Actually for rapid development right now Delphi is the new king in Rapid and easy design for simple apps like this. I was a VB6 guru, when VB.net and C#.net came out I started learning it and started dabbling in delphi. I was up to speed in delphi way faster than VB.net...

      Less effort spent getting things going if he looks at delphi instead.

      --
      Do not look at laser with remaining good eye.
    38. Re:DOS Is dead use visual basic by mcgrew · · Score: 1

      That's funny, I've got Windows 7 and it still has DOS and batch files. Jealous because you don't know how to use a command line?

      Sheesh, you kids today...

    39. Re:DOS Is dead use visual basic by networkBoy · · Score: 1

      Hell,
      We still use DOS Batch files for tons of our test scripts.
      We also use Perl and C#, but yeah... right tool for the job. I see no problem with using DOS.
      -nB

      --
      whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
    40. Re:DOS Is dead use visual basic by fbjon · · Score: 4, Insightful

      Hardly a cardinal sin. I've made a few in my day with loops and multiple choices using labels and gotos and such. Declare all important variables upfront, comment reasonably, and give it the same amount of testing as you would in a "real" language. The fact that batch files have no dependencies is a pretty good advantage, and the interpreter is backwards compatible.

      Shell scripts under *nix may be more functional, but batch files are perfectly serviceable, as long as you don't go on insane writing sprees with them.

      --
      True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.
    41. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 0

      Wow. You baffle me we how much fail your post contains.

    42. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 0

      Dumbest. Reply. Ever.

    43. Re:DOS Is dead use visual basic by gravis777 · · Score: 1

      I agree with the parent. Also, if you are just so Anti-Microsoft that you will not touch anything VB (like probably half the readers at Slashdot), check out AutoIT. We use a combination of AutoIT and VB scripts up here where I work, and they get the job done quite well.

      http://www.autoitscript.com/autoit3/index.shtml

    44. Re:DOS Is dead use visual basic by Nesman64 · · Score: 1

      The problem here, Anon, is that you booted into Windows in the first place.

      --
      coffee | nose > keyboard
    45. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 0

      You can make an icon and shortcut on the desktop for a batch file, just like you place a shortcut for anything else.

      You don't have to reboot anything. Have you heard of "Run CMD" ? Or DOSBox?

      Meatbag.

    46. Re:DOS Is dead use visual basic by Nethead · · Score: 1

      Use DOS and QuickBASIC.

      --
      -- I have a private email server in my basement.
    47. Re:DOS Is dead use visual basic by Random+BedHead+Ed · · Score: 4, Insightful

      I'm surprised no one has suggested the most obvious upgrade path from the DOS batch file, Windows PowerShell. It's the intended replacement for batch files, and basically looks like Perl, but a little more Windowsy. It's integrated with lots of .NET goodies and ActiveDirectory, but in many ways it will be familiar to DOS scripters.

    48. Re:DOS Is dead use visual basic by jim_v2000 · · Score: 1

      Honestly he shouldn't build a complex solution where a simple on will suffice. Batch files are fine for what he's doing.

      --
      Don't take life so seriously. No one makes it out alive.
    49. Re:DOS Is dead use visual basic by binkzz · · Score: 1

      It also takes up a minimum of 50 MB of RAM, and up to several gigabytes of RAM for seemingly simple scripts.

      --
      'For we walk by faith, not by sight.' II Corinthians 5:7
    50. Re:DOS Is dead use visual basic by Civil_Disobedient · · Score: 1

      I'm surprised no one has suggested the most obvious upgrade path from the DOS batch file, Windows PowerShell

      Possibly because PowerShell's performance is only slightly faster than "drunken tortoise."

    51. Re:DOS Is dead use visual basic by StikyPad · · Score: 1

      PowerShell is the recommended path, but VBScript works too. Either of those are the obvious choices where Windows machines are concerned.

    52. Re:DOS Is dead use visual basic by weszz · · Score: 1

      Autoit is the way to go... we use it a TON where I work to manage ~13,000 computers doing installations, configurations, some troubleshooting, user account creation and all sorts of things...

      Just today I used it to clean up after an HP program that leaves dead icons in the system tray... autoit waits for the process that makes it to show up, then close, and then cleans out any taskbar icons that don't have a PID attached to them.

      It's an incredibly simple language and can do just about anything...

    53. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 0

      His point was not to use any external libraries... now he has to install the whole .net framework in every machine he wants his application to work?

    54. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 0

      Ehhh.. batch files require precisely nothing to be installed in order to run.

    55. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 0

      OK. I still use DOS/CMD.COM scripts, because they do the job.

      I use them on the job.

      Two national ISPs stole my batch files, because they could not understand them, when they did, it became standard practice to use them:

      Thanks AT&T and Pacific Bell, you lying thieving BBBBBs

    56. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 0

      Firefox sucks. Get Ubuntu Linux (lol..either gamekid is a moron or very funny- I'm going with funny)

    57. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 0

      why would you suggest a compiled language to replace a scripting language? because you don't have a clue what you're talking about. Unless of course Joe meant VBScript, which is very different from VB. In that case he's not clueless, but careless.

      And I agree with those further down- moving to Power Shell is the obvious migration path

    58. Re:DOS Is dead use visual basic by Anonymous Coward · · Score: 0

      "drunken tortoise."

      You are saying about Ballmer's leadership?

    59. Re:DOS Is dead use visual basic by jgrahn · · Score: 1

      Yeah. VB, C++, Java, they all do PCL commands. Easiest way is to Build yourself a Win32 GUI, since thats what your users probably use already.

      First, aren't they already using his BAT script? Second, I wouldn't use "easiest" and Win32 in the same sentence. Third: a GUI will prevent the testers from modifying the tool, and also prevent automation. Then people will complain, and you will invent your own scripting language, as an XML specialization, and the *real* horrors will begin.

    60. Re:DOS Is dead use visual basic by bynary · · Score: 1

      Delphi makes me LOL, but not in a good way. More like when the clown shows up in Stephen King's "It".

      --
      http://www.bynarystudio.com
  2. perl? by FooAtWFU · · Score: 3, Informative

    There's Windows ports of Perl, both Cygwin and ActiveState, last I checked.

    --
    The World Wide Web is dying. Soon, we shall have only the Internet.
    1. Re:perl? by steveg · · Score: 4, Interesting

      Even better Strawberry Perl

      --
      Ignorance killed the cat. Curiosity was framed.
    2. Re:perl? by CrimsonAvenger · · Score: 2, Interesting

      There's Windows ports of Perl, both Cygwin and ActiveState

      Which pretty much blows a hole in the "single file" concept, since you'd need to include the Perl installations, and update same from time to time.

      --

      "I do not agree with what you say, but I will defend to the death your right to say it"
    3. Re:perl? by bi$hop · · Score: 1, Informative

      But do your users have perl installed? If not, you'll need to "compile" it (e.g. with ActiveState's Perl Development Kit). This actually works quite well, but it's more effort than a simple batch file.

      That being said, if you've found the best tool for the job, why are you asking for ideas on slashdot?

    4. Re:perl? by BJ_Covert_Action · · Score: 5, Insightful

      I'll second this one. The place that I work runs almost all of its commands via bat jobs that run from simple to complex. When I started here, I installed Strawberry Perl on my win32 system. I have, since, replaced every functionality that the bat jobs used to do with perl scripts (primarily for my own purposes, but most of my coworkers don't mind them either). The primary reason I did this was readability. I can set up my perl scripts in such a manner that I can look at them a year later and know exactly what I did and how I did it. All I had to do was be a little disciplined about script formatting and variable names (it's really not that hard).

      So far, I've gotten Strawberry perl to print to all of the printers on my network, run some old fortran programs successfully, update an in-house wiki automatically, automate e-mails to my co workers, and crash our entire network (that last one wasn't so much a feature, but hey, it shows just how powerful perl is). That said, I think with a bit of time and research you could probably get Strawberry perl to do exactly what you needed pretty easily. But I will warn you, when it comes to perl, I find that user experiences vary greatly.

    5. Re:perl? by BJ_Covert_Action · · Score: 5, Informative

      Oh, I should caveat one thing. In order to develop perl scripts into a distributable, platform independent, one click executable, I've been using the PAR packager module for perl. Sometimes it produces slightly bloated .exe's (since it has to bring in all of the relevant code from any external modules and dependencies), but it seems to produce very stable executables on win32 systems.

    6. Re:perl? by digitalunity · · Score: 3, Insightful

      Probably the simplest solution would be to make a Win32 executable based on the Qt toolkit and statically linked. You get a single executable, a professional looking UI that took minutes or hours to build, and the advantage of a much more powerful and flexible language versus DOS batch files or even powershell scripts.

      Qt also provides a dead simple class framework for accessing the network, so that will save you time. You can get Qt, including a really slick IDE for free from Nokia.

      --
      You can't legislate goodness. Let each to his own destiny, by will of his freely made choices.
    7. Re:perl? by Anonymous Coward · · Score: 3, Interesting

      You can cut the bloat by making the executables dependent on an external perl5lib.dll file. You can also factor out common libraries into separate PAR packages to be used by your executables. But this blows the whole point of bound exes in my opinion, and disk is cheap.

    8. Re:perl? by dredawg · · Score: 1

      Cygwin and PERL are my vote as well.

    9. Re:perl? by jsepeta · · Score: 0

      shouldn't you be documenting your code in order to remember what you did, why you did it, and how you did it many years hence?

      --
      Remember kids, if you're not paying for the service, YOU ARE THE PRODUCT THAT IS BEING SOLD.
    10. Re:perl? by Dlostboy · · Score: 1

      Activestate offers like a 30 day trial of the PDK. That'll let you turn your perl script into a nice, compact, and all inclusive .exe file that's easily offered to your users. use Mail::Sender will make emailing home a snap...

    11. Re:perl? by gandhi_2 · · Score: 1

      how about frozen python?

    12. Re:perl? by gandhi_2 · · Score: 1

      python frozen binaries are single files.

    13. Re:perl? by mooingyak · · Score: 1

      yeah my first thought was perl, ruby, python, tcl... really, ANYTHING that isn't a batch script. And I say this as someone who has written far more batch than I'd like to have.

      --
      William of Ockham had no beard. The most likely explanation is that it was chewed off by squirrels every morning.
    14. Re:perl? by Nyrath+the+nearly+wi · · Score: 1

      You can also use Nokia's Qt toolkit with the Python language using PyQt

    15. Re:perl? by oatworm · · Score: 1

      IronPython would probably work, too. Bonus points for leveraging .NET. Of course, that only makes sense if you already have .NET installed on the machines; then again, it's kind of hard not to by now.

    16. Re:perl? by nacturation · · Score: 1, Funny

      A novice had a problem and could not find a solution. "I know," said the novice, "I'll just use Perl!" The novice now had two problems.

      --
      Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
    17. Re:perl? by nicks,nicks,nicks! · · Score: 3, Funny

      I'll second this one. The place that I work runs almost all of its commands via bat jobs that run from simple to complex. When I started here, I installed Strawberry Perl on my win32 system. I have, since, replaced every functionality that the bat jobs used to do with perl scripts (primarily for my own purposes, but most of my coworkers don't mind them either). The primary reason I did this was readability.

      That's the first time I've heard Perl and better readability together.

    18. Re:perl? by Anonymous Coward · · Score: 0

      The primary reason I did this was readability. I can set up my perl scripts in such a manner that I can look at them a year later and know exactly what I did and how I did it.

      My friends, the apocalypse is upon us.

    19. Re:perl? by Undead+Waffle · · Score: 1, Funny

      That's the first time I've heard Perl and better readability together.

      He did say they started out as bat files...

    20. Re:perl? by khakipuce · · Score: 1

      Any solution like this means deploying execuatbles to user client machines. I've worked in many organisations where this is simply not possible. Things like batch and (as I suggested above) and Excel macro - assuming office is installed - are sometimes the only viable option.

      In fact I once worked somewhere where everything was locked down so tight that it was impossible to even email an executable into the organisation. I REALLY needed to get a little exe on to a machine on that network, so I wrote a base64 decoder in Excel-VBA, encoded the exe, emailed it in and used the Excel decoder to decode it so that I could run it.

      --
      Art is the mathematics of emotion
    21. Re:perl? by bigtreeman · · Score: 1

      back in the day,
      in the dim and distant past....
      when testing line and page printers
      visual basic wasn't fast enough to test the repaired printers completely
      so I used Forth, easy scripting and fast,
      easy to send any strings of any description,
      tasker to handle error states and asynchronous events

      Just try some other scripting languages
      you will find something better than batch scripts

      I even used to use a unix shell in dos
      in the early days for more flexibility in my batch files
      Dos on steroids!!!

      --
      Go well
    22. Re:perl? by BJ_Covert_Action · · Score: 1

      I do that as well. However, I find it to be very convenient when I can open the source, look at it for five minutes, and figure out exactly how the program is set up. If I've worked on something sufficiently complex, I'll break out the documentation that I wrote and go from there. However, self-documenting code is an extremely useful habit to work with in my experience.

    23. Re:perl? by Anonymous Coward · · Score: 0

      I use PerlTk for a network test app.

    24. Re:perl? by Yaleman · · Score: 1

      Wait. You said readable perl.

      I call shenanigans.

      --
      Life is a window... It just depends on what side you choose to be on...
  3. You are... by Anonymous Coward · · Score: 1, Insightful

    Crazy.

  4. Ruby or Python by AffidavitDonda · · Score: 1

    I would have thought about Ruby or Python for that kind of work. Both are easy to learn, easy to install and you can write everything from a shell script to a fully featured application. But Visual Basic would work as well I guess...

    1. Re:Ruby or Python by bsDaemon · · Score: 1

      isn't Python the Visual Basic of the FOSS world?

    2. Re:Ruby or Python by shutdown+-p+now · · Score: 1

      Given that this is Windows, an interesting approach would be to use something like IronPython and IronRuby - that gives you the whole .NET class library, which is good for two things. First, WPF - it's a very fast way to whip up UI. Then you also get access to some .NET APIs for things such as WMI, which can be helpful for admin scripts.

      Then again, PowerShell would be even better suited at this kind of task, while still allowing to use WPF etc.

    3. Re:Ruby or Python by ThePhilips · · Score: 1

      Programming Python is much much less nightmare-ish than VB.

      That's me Perl hardcore programmer saying.

      --
      All hope abandon ye who enter here.
    4. Re:Ruby or Python by Anonymous Coward · · Score: 0

      How so? Because both are popular for desktop applications??
      If not, that's not what most people would get out of your statement... if you are suggesting Python is dead, you are sadly mistaken.

      Visual Basic is significant in that it it was popular, but a Microsoft manager dictated that it MUST die... wishes of the user base be damned.
      Python's still heavily popular, and exceeds at Windows, GNOME and KDE integration.

    5. Re:Ruby or Python by MaskedSlacker · · Score: 2, Funny

      That's me Perl hardcore programmer saying.

      If your Perl code is anything like your sentences...oh, who am I kidding, it would still make more sense than MY Perl code.

    6. Re:Ruby or Python by bsDaemon · · Score: 2, Funny

      I write Perl largely like I learned to write C, so its very readable, though perhaps not particularly idiomatic.

  5. Is it pronounced DOHS or DAHS? by Anonymous Coward · · Score: 0

    I never heard anyone say it.

    1. Re:Is it pronounced DOHS or DAHS? by satoshi1 · · Score: 1

      DAWS.

    2. Re:Is it pronounced DOHS or DAHS? by Hatta · · Score: 3, Informative

      DOS sounds like "Boss" not like "dose".

      --
      Give me Classic Slashdot or give me death!
    3. Re:Is it pronounced DOHS or DAHS? by Anonymous Coward · · Score: 1, Funny

      DAWS.

      No, the S is soft as in "esss" not "zee". da "AWE" ssss

      It's pronounced the same as the word "DAS" in German; the A is soft ("AAAH" not "OH")

      So... "DAHS" is probably about right.

      And since no decent /. Anon post is complete without some kind of rant:

      The word is wash. Observe the letters, notice you have Waaaaaaaaaa and then sshhhhhhhhh.

        There is NO 'R' in wash.

        It is not pronounced WORSH otherwise it'd be spelled that way.
        It's not a regional accent, it's a complete mis-pronunciation of the word. Stop it already; it just makes you sound like you have a speech impediment. Or a single digit IQ.

    4. Re:Is it pronounced DOHS or DAHS? by AgentPhunk · · Score: 3, Funny

      The other posters are correct. You only say "DAHS" if you're from Boston, as in: "Oh My Gawhd, some retahd on slashdaht is still writing DAHS bahtch files. Why don't we just fihre up Windows fah Workgroups while we're aht it."

      Seriously though - I think nmap can send PCL commands via the nmap scripting engine, which is written in LUA. How about wrapping that with what some of the other posters are suggesting?

    5. Re:Is it pronounced DOHS or DAHS? by Anonymous Coward · · Score: 0

      WHOOSH

    6. Re:Is it pronounced DOHS or DAHS? by Anonymous Coward · · Score: 0

      You must live in western PA.

    7. Re:Is it pronounced DOHS or DAHS? by omnichad · · Score: 2, Funny

      woorsh?

    8. Re:Is it pronounced DOHS or DAHS? by Anonymous Coward · · Score: 3, Funny

      I never heard anyone say it.

      Ugh. Now I feel old. Screw you, AC.

    9. Re:Is it pronounced DOHS or DAHS? by Anonymous Coward · · Score: 0

      Is it pronounced DOHS or DAHS?

      I never heard anyone say it.

      Please leave by the nearest exit, you are clearly in the wrong place.

    10. Re:Is it pronounced DOHS or DAHS? by preacha · · Score: 1

      Bahston Sawks Cack

    11. Re:Is it pronounced DOHS or DAHS? by bynary · · Score: 1

      That's why when someone says "DOS boot" I cry. 42

      --
      http://www.bynarystudio.com
  6. iron? by Anonymous Coward · · Score: 0

    ironpython ironruby?

  7. Windows Powershell by Anonymous Coward · · Score: 1, Interesting

    Is a better scripting alternative imho.

  8. Is cygwin on the menu? by Anonymous Coward · · Score: 0

    You mentioned that you'd like it to be self contained, but would you have access to cygwin?

    A bash script is ANSI capable, you can call dos binaries, and you could also potentially take advantage of 'dialog' style interactivity:
    http://www.hightek.org/dialog/screenshots.html

  9. If It Works, It Works But Remember Your Customers by eldavojohn · · Score: 4, Insightful

    I don't know who your customers are ... is this a sort of IT mass production heavy printer thing you're producing? I'm guessing so if they're LAN printers but who knows? Anyways if you're shipping this thing to residences, give the tool to your parents or -- failing that -- someone age ~15 or ~65. Give them the documentation you have and do not say a word. See what they do with it and how intuitive it is to them and take notes while they're using it. Do they successfully test the printer or fail? If they fail, that's actually your failure. So know your audience and maybe rethink the tool. But assuming that your audience isn't afraid of a command line interface, go for it. I guess you could look into whether or not Powershell gives you any advantages (probably not). You're in a different world than I so that last suggestion may be off the mark.

    --
    My work here is dung.
  10. Powershell by Shados · · Score: 4, Interesting

    The modern way of doing shell scripting in Windows is now powershell, and most things are quickly moving toward that. Its not as integrated in the OS, but its damn close, and in many ways its better than alternative scripting languages (object piping instead of text piping, for example).

    Now if its the best thing for your requirement? I don't know. But if you're planning to stick to shell scripting, do yourself a favor and upgrade.

    1. Re:powershell by digitalunity · · Score: 2, Informative

      It doesn't, but you can download it.

      --
      You can't legislate goodness. Let each to his own destiny, by will of his freely made choices.
    2. Re:Powershell by isThisNameAvailable · · Score: 2, Informative

      If DOS made you happy, then Powershell could drive you to orgasm if you let it. Object-oriented scripting that can tap into .NET, WMI, COM objects, Windows APIs, and still read/replace part of a text file in one line. You will have to install it on older clients, but what you want can be done with Powershell 1.0, which is like 2MB.

    3. Re:Powershell by h4rr4r · · Score: 0, Troll

      Object piping is not better, it is worse.

    4. Re:Powershell by Anonymous Coward · · Score: 0, Troll

      The modern way of doing shell scripting in Windows is now powershell

      No, the modern way of doing scripting in Windows is install Bash, Perl or Python. Powershell is to modern as cat is to dog.

    5. Re:Powershell by shutdown+-p+now · · Score: 1

      It is integrated in the OS. I mean, it's part of Win7 and Win2008 R2.

    6. Re:Powershell by EvanED · · Score: 1

      Yeah, because who needs type safety when you can reparse text a bunch of times.

    7. Re:Powershell by blincoln · · Score: 1

      PowerShell is a big step forward for Microsoft, but it's still a little rough around the edges.

      For example, try using the Get-Acl command against a path that has a square bracket character in it. Now try to come up with a way to dynamically escape the character when passing a path to that command - e.g. if you are writing a function that recurses through directories and operates against each subdirectory. There were a few that supposedly worked in beta versions of PowerShell, but to my knowledge there is nothing that works in the release version.

      Most (all?) of the other PowerShell commands have a workaround for this, but Get-Acl doesn't, and it's been a problem literally for years now without a fix from MS. Issues like this are the reason I've gone back to VBScript when I'm doing scripting instead of development.

      --
      "...always new atoms but always doing the same dance, remembering what the dance was yesterday." -Richard Feynman
    8. Re:Powershell by Blakey+Rat · · Score: 1

      Yeah, but before that it was VBScript (or JScript if you prefer)... he's two entire scripting language generations behind at this point. VBScript was made for, what, NT4? Seriously.

      Reading this post was like entering the Time Tunnel. It should read, "I learned one technology in 1988 and I'm completely incapable of learning anything new, so even though there are undoubtedly much better alternatives in 2010, I'm going to use my 1988 knowledge anyway. And I'm asking here as to not sound completely pig-headed."

    9. Re:Powershell by Anonymous Coward · · Score: 0

      For one thing, [ and ] are unsupported NTFS filename characters.

      As for a solution, if you can't escape it dynamically with -replace due to interpreter constraints, then call one of the .NET functions. PS without .NET interop would be terrible, so use it.

      If the .NET functions don't work with these characters (extremely unlikely) then try translating the pathname to DOS equivalent. .NET should have this ability, but if not, you need to write a PS snapin. Not very complex.

    10. Re:Powershell by Blakey+Rat · · Score: 1

      Object piping is not better, it is worse.

      Because...?

      (This got a +2 informative? Christ. There's zero information there, mods, just one opinion.)

    11. Re:Powershell by KibibyteBrain · · Score: 2, Interesting

      It is worse because it suddenly makes one of the proposed strengths of the *nix platform look obsolete, and this is Slashdot.

    12. Re:Powershell by EvanED · · Score: 2, Funny

      The moderators are having a field day with this one.

    13. Re:Powershell by EvanED · · Score: 1

      For one thing, [ and ] are unsupported NTFS filename characters.

      What? Says who, 'cause that's news to me.

      It's also news to Wikipedia and to Windows itself, which has no problem creating a file with [ or ] in the name (and not through the Posix subsystem).

    14. Re:Powershell by v1z · · Score: 1

      No, the modern way of doing scripting in Windows is install Bash, Perl or Python. Powershell is to modern as cat is to dog.

      Umm, no. Powershell is to modern as more is to less?

    15. Re:powershell by Anonymous Coward · · Score: 0

      You can download Powershell for Windows XP and later.

    16. Re:Powershell by Anonymous Coward · · Score: 0

      Go ahead, use powershell...write some functions. Do the same with bash, python, perl, etc. My experience has been that powershell is so much slower it isnt even worth it. Python less then a second, powershell 15 minutes.

  11. Python would be my first choice. by jgritty · · Score: 4, Insightful

    Python would be my first choice.

    1. Re:Python would be my first choice. by Rob+the+Bold · · Score: 3, Insightful

      nobody cares what you think.

      I dunno. At least one guy cared enough to respond.

      --
      I am not a crackpot.
    2. Re:Python would be my first choice. by magisterx · · Score: 1

      Agreed. I know it is partially a personal preference, but I tend to find Python more powerful and more userfriendly than PowerShell or any other suggestion made so far. You do lose out on using some useful .NET classes if you use CPython, but you could use IronPython and then even have the .NET classes available.

    3. Re:Python would be my first choice. by Noiprox · · Score: 1

      Yes I'll chime in in favor of Python here too. It can easily do everything you need with a stock install, including unit testing, GUI, executing command-line commands, and generating web or email content. Plus it is easy to turn Python scripts into standalone executables http://www.py2exe.org/ Powershell would also get the job done, but it is not nearly as elegant.

    4. Re:Python would be my first choice. by jobst · · Score: 1

      that's an opinion but not a reason.

      --
      to code or not to code, that is the question.
    5. Re:Python would be my first choice. by Anonymous Coward · · Score: 0

      You mean 2... although now it's 3...

    6. Re:Python would be my first choice. by Anonymous Coward · · Score: 0

      I think the AC was referring to the lack of supporting information in the post.

      "Python rocks!" isn't very helpful - especially because the topic is "...on windows".

      Something closer to "I prefer python for this type of work because of X, Y, and Z. Here's a link to more info." would be more deserving of the +4 mod that the post currently has.

    7. Re:Python would be my first choice. by snadrus · · Score: 1

      I've had a lot of luck taking bat files and simplifying them into Python scripts so much that I think in Python now instead of batch files for batch-like processing.

      That said, there are great testing frameworks you can extend with your own tests. They work with a limited language sets (C++) but you can call a batch file from there.

      --
      Science & open-source build trust from peer review. Learn systems you can trust.
    8. Re:Python would be my first choice. by Anonymous Coward · · Score: 0

      nobody cares what you think.

      Isn't it weird how people who care what you think always refer to themselves in the third person?

  12. As a perl geek I have to say... by elFisico · · Score: 1

    use perl; # :-)

    Perl is a much better scripting/programming language. You can even use Tk for a more windowy experience. And if you cannot do what you want to do directly in perl, you can still call a DOS batch file that does the windows-specific things...

    1. Re:As a perl geek I have to say... by Smallpond · · Score: 2, Informative

      http://search.cpan.org/~karasik/Win32-GuiTest-1.56/lib/Win32/GuiTest.pm

      Perl has plenty of Windows-specific modules made for this type of application.

  13. Python by bmecoli · · Score: 3, Informative

    Python is my scripting language of choice because it's easy to use and it has it's own "os" module that you can use to launch commands and the like, not to mention the "glob" module, which can grab all file names in a given directory into an array. I highly recommend it. (2.6)

    1. Re:Python by lmpeters · · Score: 2, Informative

      Python is my scripting language of choice because it's easy to use and it has it's own "os" module that you can use to launch commands and the like, not to mention the "glob" module, which can grab all file names in a given directory into an array. I highly recommend it. (2.6)

      Python also has a built-in "unittest" module that might make it a lot easier to manage your various test cases. I'd say if you can't count all of your test cases on one hand, you should take a serious look at that module.

    2. Re:Python by Anonymous Coward · · Score: 0

      You know a bunch of computer languages, each more obscure and difficult than the other, yet you can't tell ITS from IT'S in english?

    3. Re:Python by Nyrath+the+nearly+wi · · Score: 1

      Not to mention the fact that one can use Nokia's Qt framework in Python using the PyQt bindings. So you can make a professional looking GUI in minutes.

  14. Well, try the new model by Cruise_WD · · Score: 0

    Powershell might be worth a look.

    Admittedly, Microsoft's attempt to add proper shell scripting is pretty much what you'd expect from Microsoft - overly complex, inconsistent and monolithic, but it is pretty powerful.

    --
    [ cruise / casual-tempest.net / xenogamous.com / transference.org / quantam sufficit ]
  15. AutoIt? by Anonymous Coward · · Score: 5, Informative

    Its a great tool thats free, and has good GUI and has good scripting capabilities too:

    http://www.autoitscript.com/autoit3/index.shtml

    1. Re:AutoIt? by Anonymous Coward · · Score: 0

      I'll second AutoIT. I've used to write some fairly complex push and/or pull build scripts in the past. The syntax is essentially the same as VB.

      You can compile the scripts to standalone .exe (ie no run time etc required) making deployment easy - why not write a deploy script :)

      If the script needs to reference password info then the compilation to .exe provides a basic protection from exposing the password to users, though it is trivial to decompile so don't rely on it for sensitive data protection.

      User prompting is super simple from simple Yes/No/Cancel to text input prompts and file choosers.

      Also useful for automation of apps that don't provide a decent API, via some nice UI manipulation functions (mouse and keyboard events). Quite a few game bots have been written with AutoIT.

    2. Re:AutoIt? by soporific16 · · Score: 1

      I also recommend this, i only use batch scripts and AutoIT scripts ... the language does have a few funny limitations where you will actually find youself using it to run batch commands (moving entire folder trees is one example) but for the ability to write a script in 2 seconds and compile it on the spot for immediate testing, AutoIT is king. It was originally designed to automate rolling out 1000s of new Windows machines and so it was designed to control a Windows machine intimately. i can't recommend it enough :)

    3. Re:AutoIt? by LinuxIsGarbage · · Score: 1

      I second / third AutoIT. It's designed for Windows automation as opposed to trying to be universal, meaning you can use it to drive GUIs with ease, and opens up doors for future automation projects. I'm not big on programming but AutoIT lets me rough up some code pretty quick. And I find myself finding uses for it for lots of small projects. You can also create GUIs with it meaning a prettier / more contemporary UI for your script.

    4. Re:AutoIt? by C0L0PH0N · · Score: 1

      I also heartily recommend AutoIT's cousin, AutoHotKey. You can write a GUI program with menus and compile it to a small EXE executable if you like. It is super for replacing batch files.

    5. Re:AutoIt? by PhilHibbs · · Score: 1

      Seconded. I've written a small library for driving command prompt applications in AutoIt.
      http://www.autoitscript.com/forum/index.php?showtopic=112372&st=0&p=795177&#entry795177

    6. Re:AutoIt? by teridon · · Score: 1

      I had a horrible experience with a AutoIT GUI program because their API changed quite a bit between releases. I don't recommend it to anyone anymore because of that.

      See my comment above:
      http://ask.slashdot.org/comments.pl?sid=1666054&cid=32360238

      --
      I hold it, that a little rebellion, now and then, is a good thing. -- Thomas Jefferson
    7. Re:AutoIt? by JSThePatriot · · Score: 1

      AutoIt is not only a great language to automate any MS Windows based tasks, but also has the best Help file I have EVER seen for any language or framework out there. Then you add the forums on top of that. The forums are a great resource to search through, and also to ask your questions!

      I have created an entire testing framework for a previous employer completely written in AutoIt. It allowed them to easily create new test cases without writing any code, and then it allowed them to schedule the test cases to be automatically executed. AutoIt is a very flexible language, and is quick and easy to pick up and learn. I would recommend it over VB or VB.NET as those have a higher learning curve, and I don't feel they can do the same job with the same ease that AutoIt provides.

      AutoIt allows you to create simple scripts, or complex GUI Applications. It's your choice. It compiles into a single executable. You can even include files into your executable to be unpacked at runtime to be used. There are so many unique features. A simple AutoIt script is also a little over ~200kb. That's all the overhead. As your script gets more complex that grows, but not significantly. (Unless you add files like I was saying). AutoIt was originally designed to automate tasks across the network, and it needed to be small enough to be able to be sent all over the network without clogging the "pipes". That vision has continued to be maintained.

      I wanted to address what someone said above about upgrading to the latest and having some issues with the functions they were using previously. AutoIt is very good at marking changes that have occurred, and they try to not implement things that break previous versions, but as with any living language things do change, and before you upgrade to the latest framework of anything you should always test it first. I understand the frustration...(I had multiple scripts to update as well)...but all that had to be done was a bit of research, and then things would have been much easier.

      AutoIt
      AutoIt Forums
      AutoIt Documentation
      AutoIt Downloads

      I hope this helps you in your endeavor,
      Jarvis

    8. Re:AutoIt? by weszz · · Score: 1

      I've had good luck with autoit for the 3 or so years i've worked with it.

      only had to modify things a few times. normally if you look in the help file it will tell you when things are depreciated, and from my experience lately they haven't changed core functionality...

      I've used it for all kinds of odd things, like a request to automate right clicking in the system tray on a specific icon to insert credentials when a DOS window opened with a specific title.

      You can't just plug in coordinates, you have to list all the icons by name, find the name you want, pass that array value in with the right click through a .dll and then pick the right one from the list... i was very impressed it could do it.

  16. powershell by Anonymous Coward · · Score: 0

    i think microsoft is aiming for powershell to replace .bat files, BUT you'll need windows 7. I'm not sure if vista ships with power shell.....

  17. Try Windows PowerShell by UTF-8 · · Score: 3, Interesting

    DOS batch files has too many limitations when compared to other scripting languages. It's frozen in time. I consider Windows PowerShell to be the batch file successor.
    http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx

    1. Re:Try Windows PowerShell by Anonymous Coward · · Score: 0

      "DOS batch files has too many limitations when compared to other scripting languages."

      DOS or CMD? CMD is the later shell and it doesn't have that many limitations at all.

  18. Okay by srwalter · · Score: 3, Funny

    You're crazy.

    --
    Freedom is the freedom to say that 2 + 2 = 4
    1. Re:Okay by phantomfive · · Score: 1

      Exactly. I've programmed in dozens of programming languages and DOS shell scripting is the only one that made me want to scratch my eyes out with a fork. There are incompatibilities between versions, as in useful functionality was taken out. Why would you do this, Microsoft? Why? It was, frankly, my most miserable (real) programming experience.

      Still, it did what I needed it to do, after everything. So I would probably do it again if I had to.

      --
      Qxe4
    2. Re:Okay by Com2Kid · · Score: 1

      as in useful functionality was taken out.

      Hmm?

      I have done my fair share of batch file writing, what exactly was taken out?

    3. Re:Okay by Anonymous Coward · · Score: 0

      One that definitely got removed - choice /c to perform simple interaction. Taken out with Windows 2000, if I remember correctly. You may be able to work around this with set /p, but it's not as elegant. (Elegance in batch files, what have I typed?).

      Back on topic, for OP's question - if you can do it in batch, do so. It's quick, easy enough to repurpose and built in to any windows box. VBScript would be my next choice, particularly if file handling (other than piping output) or any involved decision-making needs to take place. Powershell might be a third option, but I've not used that enough to be able to make an informed choice.

      As regards perl, python, awk (god help me) and any other languages that can be compiled into a stand-alone, if you have the skillset to use them then do so. Have at it.

      The one thing I'm interested in is why anyone would ask such a question? If it's a small script that's only going to take a couple of afternoons to put together, why not select two or three scripting languages and give it a bash. If you get into difficulties with either the language or getting it to do what you want, fling it and try something else. You might even want to chain two languages together to capitalise on the strengths of both.

  19. Execute Shell commands with Ant by decipher_saint · · Score: 2, Interesting

    Not sure why batch is such a bitch, but you can execute shell commands with Ant.

    --
    crazy dynamite monkey
    1. Re:Execute Shell commands with Ant by Anonymous Coward · · Score: 0

      But then the customers would spend all day waiting for the JVM to load.

  20. 15 minutes could save you... by schmidt349 · · Score: 3, Funny

    Are DOS Batch files too 1990s to be taken seriously in 2010?

    Is Ed "Too-Tall" Jones too tall?

    1. Re:15 minutes could save you... by Bigjeff5 · · Score: 3, Funny

      Does Charlie Daniels play a mean fiddle?

      --
      Security is mostly a superstition... Avoiding danger is no safer in the long run than outright exposure. - Helen Keller
    2. Re:15 minutes could save you... by Anonymous Coward · · Score: 0

      Does a ten pound bag of flour make a really big biscuit?

    3. Re:15 minutes could save you... by Anonymous Coward · · Score: 0

      Does a ten-pound bag of flour make a really big biscuit?

    4. Re:15 minutes could save you... by phozz+bare · · Score: 1

      Are DOS Batch files too 1990s to be taken seriously in 2010?

      No, they are too 1980s.

    5. Re:15 minutes could save you... by Anonymous Coward · · Score: 0

      Does Elmer Fudd have trouble saying 'R's ??

  21. He's right. by Anonymous Coward · · Score: 3, Informative

    For Windows platforms, there's nothing better for rapid prototyping than VB.NET - or really any of the .NET languages. Plus, you can get a version of Visual Studio from Microsoft for free that will do everything you want. Plus, you definitely won't regret having VS as a debugging environment.

    Think of how happy your customers will be to interact with a modern-looking app that only took you a few hours to put together!

    1. Re:He's right. by Anonymous Coward · · Score: 4, Informative

      AutoHotKey or AutoIt are better and they are free unlike Visual Basic.

    2. Re:He's right. by kelsey.grammer · · Score: 5, Informative

      AutoHotKey or AutoIt are better and they are free unlike Visual Basic.

      Mod this up. I've used C++, Java, Perl, Ruby, vbscript, batch, and likely a few more to do this kind of thing in Windows over the years. For something this small I haven't found anything that beats AutoIt. It's so easy to learn and is fantastic for creating small, standalone executables with a GUI on Windows. This task is a perfect fit.

      --
      I reflect your pompous signature back upon you.
    3. Re:He's right. by iwannasexwithyourmom · · Score: 1, Informative

      VB Express is Free, and probably much more powerful. (although I've never seen AutoIt so I can't have an opinion there)
      http://www.microsoft.com/express/Downloads/#2010-Visual-Basic

    4. Re:He's right. by Rophuine · · Score: 1

      Visual Basic is free.

    5. Re:He's right. by Machtyn · · Score: 2, Informative

      I disagree. Use Tcl/Tk, Perl/Tk, or any other cross OS scripting language that contain a graphical toolkit. Using Tcl/Tk at my last job, I was able to create some nifty little utilities with a GUI, and I didn't have to worry about compiling. I also didn't have to install Tcl/Tk on each computer that was going to use it, as I used a wrapper to put it together for release.

      I still used the command shell fairly extensively when it was needed and I used C# when it was called for. Right tool for right job and all that.

      Windows Vista or later have a SUA (Subsystem for Unix Applications) and Powershell. While I have only just started looking into Powershell, it looks like a very good shell for Windows systems that finally (almost) brings it up to Linux/Unix standards of a shell.

    6. Re:He's right. by Anonymous Coward · · Score: 0

      VB is commercial and VB Express is crippleware. AutoIt is freeware and AutoHotKey is open source.

    7. Re:He's right. by e70838 · · Score: 1

      I fully agree with Tcl/Tk.
      Using a batch file for your very simple tasks (running sequences of commands, with simple user interactions) is a very interesting idea. If you were using smarter language like VB, Java, Perl (I love Perl), Python, Ruby, PHP or similar, there is a big risk that the program evolves to include more and more language specific tricks. By using a very limited language, as long as you don't need to use tricks to circumvent these limitations, you limit the possibility of nasty evolutions.
      There are two problems with this approach:
      - you may encounter new needs for which the limitations of DOS will be a real pain (in fact, it is already the case with ansi.sys)
      - this is not the kind of application that can be cleanly wrapped to be delivered to a customer. A customer deserves something polished.
      Tcl/Tk is the good choice for your purpose: a simple, stupid, limited language, but providing all the features needed for clean simple user interfaces and smart installations wrappers that make it look like windows native applications.

    8. Re:He's right. by MadKeithV · · Score: 2, Informative

      Mod parent up - Visual Basic *SCRIPTING* is free on the windows platform.

    9. Re:He's right. by Anonymous Coward · · Score: 0

      cool where do i get the source so i can port it to linux? always wanted to try that stuff out.

    10. Re:He's right. by PsychoSlashDot · · Score: 1

      VB is commercial, VB Express is crippleware in the sense that he'll have to distribute his compiled solutions via either a web site or a .exe (which is no impediment) and in every other way will do the job he describes.

      Try to keep a perspective. The OP isn't trying to rewrite Office or AutoCAD.

      --
      "Oh no... he found the .sig setting."
    11. Re:He's right. by teridon · · Score: 4, Informative

      AutoIt is nice -- the first time. That's how they hook you.

      Then, a year later, you decide to update your program. And hey, why not update to the latest version of AutoIt while you're at it? There was this one bug that always annoyed you, and you hope the devs fixed it.

      Well, guess what? While you had your back turned, all the APIs for the GUI changed. All those calls you made to AwesomeFunction() now require 4 arguments instead of 3. Oh, and one of them is now an object instead of string.

      That was my personal experience, anyway. After wroting a GUI program with perhaps 3000 lines of code, I updated to the new version of AutoIt. It seemed I had to practically rewrite the entire thing. Since then, I haven't recommended AutoIt to anyone that I like.

      --
      I hold it, that a little rebellion, now and then, is a good thing. -- Thomas Jefferson
    12. Re:He's right. by BlueMonk · · Score: 1

      Crippleware is software whose features or use is severely limited (sometimes to the point of being practically useless -- unable to save for instance) for the sole purpose of persuading the user to pay for the complete software if they would find it useful. VB Express does not, in my mind, fit this definition because I write a lot of software these days in VB and C#, and I believe it could compile any of it in the express edition. The IDE has some different features (some friendlier than the full-blown visual studio like the way refactoring works, I think) and some that aren't as deep as Visual Studio's (the debugger doesn't have a quick watch window, so you have to watch variables in the regular watch window, for example), but that's hardly crippling. It's just a lower-end simpler environment that's very useful as a stand-alone product for those who don't want to buy the full Visual Studio. As a professional Visual Studio developer, I use Visual C# Express at home and have never felt compelled to upgrade to Visual Studio (which I could probably legally do by simply installing my copy from work). So if it's crippleware, it's a miserable failure at coming across as "crippled". I find it very useful.

      I would also point out that you don't need to install Visual Basic Express in order to compile and run VB programs. Any system with the .NET framework installed can compile and run VB .NET projects. If you have .NET 3.5 or later, you can even directly compile the solutions/projects files as generated by Visual Studio by using MSBUILD.EXE (which, for .NET 3.5, is found in Windows\Microsoft.NET\Framework\v3.5\).

    13. Re:He's right. by Anonymous Coward · · Score: 0

      What makes you think that GP poster likes the OP poster?

    14. Re:He's right. by Anonymous Coward · · Score: 0

      Crippleware is any "Lite" version or "normal" version of a pay for "Pro" product. If it limits you AT ALL compared to a "full version" in order to get you to buy, then it's crippleware.

    15. Re:He's right. by Anonymous Coward · · Score: 0

      Plus, you can get a version of Visual Studio from Microsoft for free that will do everything you want. Plus, you definitely won't regret having VS as a debugging environment.

      Have you seen this? Three months of zombie windows and counting:

      http://blogs.msdn.com/b/debugger/archive/2010/03/11/help-my-console-windows-won-t-go-away.aspx

    16. Re:He's right. by BlueMonk · · Score: 1

      No, it's not. Look up the definition of Crippleware.

    17. Re:He's right. by Anonymous Coward · · Score: 0

      Yes it is. I suggest that *you* go look up the definition since you clearly haven't got a fucking clue.

      Crippleware: Crippleware is any product whose functions have been limited (or "crippled", thus the name) with the express purpose of requiring the user to pay for those functions (either paying a one-time fee or continually paying a service). Crippleware is also used to describe software that makes use of Digital Rights Management. Crippleware programs are usually free versions of computer programs that lack the most advanced (or in some cases, even crucial) features of the original program. Crippleware versions are made available in order to increase the popularity of the full program without giving it away for free. An example of crippleware is a word processor that cannot save or print.

      Crippleware: In economics, a damaged good (sometimes termed "crippleware" or product with "anti-features") is a good that has been deliberately limited in performance, quality or utility, typically for marketing reasons as part of a strategy of product differentiation.

      All of which precisely fit the properties of and reasoning behind VB Express.

    18. Re:He's right. by cmos-reset · · Score: 1
      That doesn't seem to happen with AutoHotkey. If your app is just a couple of buttons that run external commands then that kind of thing isn't going to change between interpreter versions.

      You can easily replicate .bat functionality with AHK. AHK is absolute genius; simple, fast, portable, and the ability to compile the script to .exe is flatout awesome.

      Compiled size starts around 200KB-220KB, which consists of the ahk interpreter and the script, and a dll that you can strip out and save 30KB if you really want to - but for the purpose of the OP you wouldn't as it would risk the portability, and AHK is fantastic - it's basically the .bat mentality for the win32 world with a few tweaks and prettier interface.

    19. Re:He's right. by Z80xxc! · · Score: 1

      AutoHotKey or AutoIt are better and they are free unlike Visual Basic.

      Incorrect, good sir! Visual Studio 2010 Express Edition is free!

    20. Re:He's right. by BlueMonk · · Score: 1

      Looks like you pounced on definitions that matched your preconceived notions (or at least you thought they matched) because you're using the definition of "damaged goods" from Wikipedia, but if you had read a little further on Wikipedia, you'd have seen a more specific definition of Crippleware for computer software:
      The term "crippleware" is sometimes used to describe software products whose functions have been limited (or "crippled") with the sole purpose of encouraging or requiring the user to pay for those functions (either by paying a one-time fee or an on-going subscription fee).

      It would be quite a stretch to fit Visual Basic Express to this definition for a few reasons:
      1. The Express Edition doesn't ask for any one time fees to "upgrade" to any full version. (Visual Studio is a separate product.)
      2. The Express Edition (at least the one that I have, as far as I can tell) doesn't even advertise the fact that a more complete edition exists or that I could upgrade. This enhances the notion that there are not one time fees associated with any "upgraded" version of this product.
      3. There's no subscription fee involved in Visual Basic Express or Visual Studio, so that doesn't help it fit the definition either.
      4. In the help menu of Visual C# Express (which I assume is similar to Visual Basic Express) there *is* a "Register" option, but it's free, further extending the notion that this is not a limited version of a full product.
      5. Even the Visual Studio Express web site goes out of its way to advertise features of the express edition that don't exist elsewhere (thus implying the existence of Visual Studio, but distinguishing the Express Edition as having its own unique advantages). It points out that Visual Studio (framed as a separate product) has it's own trial version. That trial version is limited, but Visual Studio Express is not. This further extends the notion that this is a stand-alone product, not representing a limited version of something whose "sole purpose" is to make you pay for an upgrade. I call your attention to the comment on the Express web site: "Unique to Visual Studio® 2010 Express is a new streamlined user experience that focuses on the most common commands by hiding some of the more advanced menus and toolbars. These are easily accessible by users via the Tools / Settings menu".

      Based on this (and other comments on the web site), it looks to me like the purpose of Visual Studio Express is to cater to a different audience. Admittedly it is an audience with less of an expectation of some of the more advanced features, but Visual Studio Express is limiting the visibility of these features in the interest of catering to this "simpler" audience (not enticing them), and in most cases, even provides those features for free, just in a less visible way, so as to avoid overwhelming and confusing the user.

      This clearly is not a product whose "sole purpose" (wikipedia) or "express purpose" (thefreedictionary) is encouraging the user to pay for a full product. They have one of those for Visual Studio, and it's called the trial version; it's not Visual Studio Express.

      So you best get your facts straight before you go swearing at and insulting someone (never a good policy anyway). Your argument is wearing pretty thin.

    21. Re:He's right. by BlueMonk · · Score: 1

      Regardless of the semantics over which we're arguing, am I correct in understanding that your point was that Visual Studio Express by itself is not useful because it's limited? I simply want to point out that for the purpose of the original poster, Visual Studio Express more than fulfills his needs (and the needs of many other people). The limitations are not a significant hindrance in this case (nor in any case for which I've ever used Visual Studio, and I'm a professional).

    22. Re:He's right. by Anonymous Coward · · Score: 0

      Pounced? Those definitions are from two of the mostly commonly used resources on the web, so I don't know what the fuck you're talking about. Oh, that's right. You feel like a fucking idiot and have to make up some excuse to try to save face.

      Really, just shut the fuck up before you make yourself look more stupid then you already have.

    23. Re:He's right. by BlueMonk · · Score: 1

      I'm not contesting your sources. In fact I used one of your same sources (wikipedia) to show you what was wrong with your point. If you had read what I said, you'd see I simply pointed out that you used an irrelevant part of the wikipedia entry. I used a more relevant part of the same entry to show you what you missed.

      You're the one who seems to be short on vocabulary and patience here. You didn't even try to respond to my actual points. You just blew up at my first sentence and tried to end the discussion with a "shut up". So it looks like I'm not the one trying to save face.

    24. Re:He's right. by Anonymous Coward · · Score: 0

      Visual Basic Express is free.

  22. dig your boldness by Crackez · · Score: 3, Informative

    must be nostalgic for you or something...

    If it were me, I would put together what you need to work with Cygwin, then it could be cross platform. You could even ship a copy of cygwin.dll and any binaries you need, like bash, netcat, or what have you. I prefer Unix apparently.

    1. Re:dig your boldness by kybred · · Score: 2, Informative

      You could even ship a copy of cygwin.dll and any binaries you need, like bash, netcat, or what have you. I prefer Unix apparently.

      Be careful about that.

      I use Cygwin myself, but copying the .dll for use with your app is fraught with peril.

    2. Re:dig your boldness by Anonymous Coward · · Score: 0

      self contained cygwin is not

    3. Re:dig your boldness by Anonymous Coward · · Score: 0

      I don't think you are allowed to distribute the cygwin.dll yourself.

    4. Re:dig your boldness by Crackez · · Score: 1

      I was picturing bash/sed/awk/whatever scripts replacing his current batch scripts. Distributing several unmodified GPL binaries, so long as the source is also available, is perfectly acceptable as I understand it...

      Also, if this is software that is not going outside your organization, then I don't think you have to worry about it at all...

    5. Re:dig your boldness by kybred · · Score: 1

      Distributing several unmodified GPL binaries, so long as the source is also available, is perfectly acceptable as I understand it...

      Also, if this is software that is not going outside your organization, then I don't think you have to worry about it at all...

      Not to be picky, but from the Cygwin license (emphasis mine)

      If you distribute the Cygwin DLL, either in its original form or in a form modified by you, you must adhere to the terms of the GPL, i.e. you must provide sources for the Cygwin DLL unless you have obtained a special Cygwin license to distribute the Cygwin DLL in only its binary form (see below).

      But yes, if you don't distribute, no problem.

      But the other thing I was trying to point out is if you supply a version of the Cygwin dll and the user has a different version already installed, you can run into problems.

  23. Sensible Suggestion... by Elitist_Phoenix · · Score: 2, Funny

    I believe the only sensible and practical idea here is to have 1000 monkeys at 1000 consoles doing these automated tasks for you. Of course you'd need to feed these monkeys, so you'd need more monkeys. Thus, 1000 monkeys at 1000 banana plantations.

    --
    "I'm going to f***ing bury that guy, I have done it before, and I will do it again. I'm going to f***ing kill Google"
    1. Re:Sensible Suggestion... by GNUALMAFUERTE · · Score: 1

      Well, your idea is a little bit complex to implement, but certainly more logical than using windows and batch files.

      --
      WTF am I doing replying to an AC at 5 A.M on a Friday night?
    2. Re:Sensible Suggestion... by lgw · · Score: 1

      Seems like a decent idea, though you'd also need a system for replacing failed monkeys, motivating monkeys that are slacking, etc. Fortunately, there's an RFC that covers all of this.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    3. Re:Sensible Suggestion... by Jane+Q.+Public · · Score: 1

      At the risk of sounding bigoted, this sounds rather like those Indian companies that will manually bypass captchas for you. Throw enough cheap labor at it, it gets done.

    4. Re:Sensible Suggestion... by Anonymous Coward · · Score: 0

      I believe the only sensible and practical idea here is to have 1000 monkeys at 1000 consoles doing these automated tasks for you. Of course you'd need to feed these monkeys, so you'd need more monkeys. Thus, 1000 monkeys at 1000 banana plantations.

      Are you high when posting this stuff?

    5. Re:Sensible Suggestion... by Anonymous Coward · · Score: 0

      Your suggestion is interesting, but it has an obvious failing in that it would take an infinite amount of time to get the job done.
      But as a bonus you would have a copy of the complete works of Shakespeare to go along with the user manual.

  24. Hate to say it... how about vbs? by Anonymous Coward · · Score: 5, Informative

    Python is much easier to write and much more maintainable than a batch script. Unfortunately it can be unfeasible to require this dependency on Windows machines.

    Good dependency-free (albeit platform-specific) alternatives are .vbs (visual basic script) and .js. Both allow access to more modern dialog boxes etc. Either script should be executed under wscript.exe (windows scripting host) but I believe there is an automatic file association by default (at least for .vbs files).

    For a more modern alternative, try Powershell, however it is only present by default on Windows 7.

    1. Re:Hate to say it... how about vbs? by rubies · · Score: 2, Informative

      I second VBS - asking a customer to install Perl is just asking for trouble unless you're in Unix land. The reason Bourne shell is popular isn't because it's particularly good, but because you know it (or a close variant) will always be available on any *nix.

      VBS isn't particularly nice to program in, but if you know what you're doing you can call most windows functions and even do database queries if that floats your boat. Networking stuff is a breeze and you can do a dialog based GUI if necessary.

    2. Re:Hate to say it... how about vbs? by ImprovOmega · · Score: 3, Informative

      The biggest advantage of VBScript is its easy exposure of practically all COM API's on the machine. This lets you run a ridiculous amount of automation tasks from VBScript, but you are horribly limited in the sense that it's really not an object oriented language. It lacks ability to do pointers and even structs (C-style structs that is) making any kind of advanced data structures cumbersome to implement. But for scripting it's leaps and bounds above batch files *shudder* so I have to give it a nod for the original question.

      The one big problem with going GUI though is that its GUI objects do lend themselves to much customization. You cannot, for instance, create a list of buttons to pick from. You would almost want to use the cscript interface and go from there. That still embeds you in a DOS window, but hey.

      Also VBSEdit is a killer IDE for developing VBScripts. It will even produce straight executables for you to help cut down on people breaking your plaintext scripts.

    3. Re:Hate to say it... how about vbs? by shutdown+-p+now · · Score: 4, Informative

      Indeed, Active Scripting with VBscript or JScript is the only alternative if it has to run without any extra dependencies. It's available as a stock component from at least Win2K (I believe it's actually Win98, but can't be bothered to check; and I'm certain about Win2K). And while VBScript is ugly, JScript is a rather decent interpreted implementation of Ecma-262, and has enough hooks to do the stuff that is required here. And it's infinitely better than DOS batch files, that's for sure.

    4. Re:Hate to say it... how about vbs? by forkazoo · · Score: 2, Funny

      Python is much easier to write and much more maintainable than a batch script. Unfortunately it can be unfeasible to require this dependency on Windows machines.

      You can just make an exe out of a python script which collects the runtime and all dependencies into a single file. I'd want to do that before resorting to invoking VB. I guess if it is an all-MS shop locked in some sort of hellish time vortex (which is consistent with the OP asking about batch files) then they may keep enough Eye of Newt and pentagrams handy to make VB seem like a convenient option.

    5. Re:Hate to say it... how about vbs? by fishexe · · Score: 1

      Python is much easier to write and much more maintainable than a batch script. Unfortunately it can be unfeasible to require this dependency on Windows machines.

      Good dependency-free (albeit platform-specific) alternatives are .vbs (visual basic script) and .js. Both allow access to more modern dialog boxes etc. Either script should be executed under wscript.exe (windows scripting host) but I believe there is an automatic file association by default (at least for .vbs files).

      For a more modern alternative, try Powershell, however it is only present by default on Windows 7.

      But what if your users think it's a virus, because they've been taught never to open .vbs files?

      --
      "I don't care about the Constitution!" --Bill O'Reilly, November 17, 2009
    6. Re:Hate to say it... how about vbs? by Anonymous Coward · · Score: 0

      Dependency shmendency.

      Just wrap it up in py2exe or switch to ironpython and compile directly. I do this all the time in my company.

    7. Re:Hate to say it... how about vbs? by thedt · · Score: 1

      Powershell lets you do everything VBScript can :) and its .net :D

    8. Re:Hate to say it... how about vbs? by vlueboy · · Score: 1

      Good dependency-free (albeit platform-specific) alternatives are .vbs (visual basic script) and .js. Both allow access to more modern dialog boxes etc. [...] I believe there is an automatic file association by default (at least for .vbs files).

      There is a default association. The ubiquity, power to automate tasks and download or chain other code, is all there, even if we don't care to use it any more than we cared for DOS. This level of automation available by default is exactly what made e-mail attachment code in the form of small plaintext files so powerful.

    9. Re:Hate to say it... how about vbs? by goranb · · Score: 1

      exactly, VBS is a tool one can actually live with...
      I personally prefer bash (where available), but on "bare" Windows, I'll usually start (and end) scripting in vbs...

      all the tools you need are on the system, notepad, explorer, and internet explorer (to access the documentation, a must for me *blush*)

      but also, if you can "get away" with the least amount of effort, do it... no need to feel "ashamed" about using batch files, IMHO

    10. Re:Hate to say it... how about vbs? by Anonymous Coward · · Score: 0

      Maybe we'll get lucky and IronPython will be shipped with Windows 8 *fingers crossed*

    11. Re:Hate to say it... how about vbs? by Anonymous Coward · · Score: 0

      If you use cscript.exe it will run in the console. No Windows GUI needed.

    12. Re:Hate to say it... how about vbs? by TerranFury · · Score: 1

      It lacks ability to do pointers and even structs (C-style structs that is) making any kind of advanced data structures cumbersome to implement.

      JScript avoids these issues and feels much nicer to me (just personal preference). The downside is that you'll find more documentation for VBScript than JScript.

  25. Re:If It Works, It Works But Remember Your Custome by NFN_NLN · · Score: 3, Insightful

    Give them the documentation you have and do not say a word

    If your product requires a manual than your user interface sucks.

    Add a wizard for common scenarios... anything but documentation that no one will read.

  26. 4DOS! by Anonymous Coward · · Score: 1, Informative

    It was extended to 8.00 by Luchezar Georgiev[1], and supports REXX interpreter, including free ones[2].

    [1] http://www.4dos.info/
    [2] http://www.4dos.info/dalter.htm#08

  27. I have a saying by buss_error · · Score: 5, Insightful

    "If it's stupid and it works, it's not stupid."

    There are plenty of doges you can use, perl, python, bash, and lots more. But all of them add a level of complexity to this that the batch file doesn't have. Which leads me to my second saying:

    "If it's simple and it works, it's elegant."

    Sounds like you've found an elegant solution to a problem. I'd stick with it if it works for you.

    --
    Necessity is the plea for every infringement of human freedom. It is the argument of tyrants; it is the creed of slaves.
    1. Re:I have a saying by Mr.+Underbridge · · Score: 2, Informative

      There are plenty of doges you can use, perl, python, bash, and lots more. But all of them add a level of complexity to this that the batch file doesn't have.

      What complexity does python add (for instance)? From the user's standpoint, if the .py file is associated with python (and it will be), double-clicking on the icon will run just like a batch file. And as pointed out, python can execute system commands too.

      I can see wanting to avoid cygwin, but python's a breeze.

    2. Re:I have a saying by __aaubnk9535 · · Score: 3, Informative

      I can see wanting to avoid cygwin, but python's a breeze.

      Except for the fact that python run-time libraries aren't included with Windows, yeah, great.

    3. Re:I have a saying by masher_oz · · Score: 0, Redundant

      Yes, but you also require the user to have Python installed. I know that I don't have Python on my computer.

      A Windows batch file requires you to have Windows installed. I know that I do have Windows though...

    4. Re:I have a saying by Anonymous Coward · · Score: 0

      The complexity is requiring the end-user to have Python installed.

    5. Re:I have a saying by Jaime2 · · Score: 1
      DOS batch files make reusing scripts very difficult. Pretty much anything else is better. The lack of a function or subroutine construct is its biggest downfall. This can quickly lead to cut-and-paste hell or a pile of work-arounds that makes the scripts almost impossible to maintain.

      BTW, your quote:

      If it's stupid and it works, it's not stupid.

      ... is pretty much the opposite of how professional programmers feel. My philosophy is that any idiot can keep banging on the keyboard until it works. It takes a reasonably competent programmer to make it so that the next guy can understand it and maintain it. It takes a good programmer to make it so a new unanticipated feature can be added quickly without disturbing the system too much. I actually ask questions at interviews to try to find people with your philosophy and weed them out.

    6. Re:I have a saying by Rob+the+Bold · · Score: 0, Redundant

      What complexity does python add (for instance)? .

      Since I'm guessing this is a Windows environment -- installing Python. I wouldn't think it would be a big deal if the users were already installing the system being tested. But you did ask, and that is a slight increase in complexity.

      --
      I am not a crackpot.
    7. Re:I have a saying by MidnightBrewer · · Score: 1

      If this is a customer-oriented tool, then I'd say rewrite version 2 in a more future-proof, platform-agnostic language. These are customers, and keeping an edge over the competition means offering something more than the other guy. Working in a situation where we're dependent on a single-source vendor who regularly ignores us even for their contractually obligated responsibilities, we're chomping at the bit for the first opportunity to jump ship and find someone else as soon as our contract expires. Give the customer what they pay for plus a little extra and you'll be rewarded.

      Not to mention that breaking the lock-in to one platform means expanding your potential customer base (unless the only customers you get are locked into Windows as well for industrial reasons).

      --
      "Give a man fire, and he'll be warm for a day; set a man on fire, and he'll be warm for the rest of his life
    8. Re:I have a saying by Anonymous Coward · · Score: 0

      Need to have python interpreter/runtime installed. On windows boxes, ".bat" files run intrinsically, with no added overhead or maintencane or version dependencies.

      So, not only do you have to deploy the .Py file, you have to rollout the python runtime environment as well. That makes it a more complicated solution than the dos .bat files.

      Seriously, .BAT can do a whole lot of interesting things, if properly constructed.

    9. Re:I have a saying by MaskedSlacker · · Score: 1

      "If it's stupid and it works, it's not stupid."

      Fortunately this is a stupid saying that doesn't work, so it may be safely ignored.

      There are a wide range of possible values for 'works,' which range from 'worked that one time when I stood on my head and quacked like a duck,' to 'fucking-bullet-proof.'

      Of course, higher values of 'works' cost more, but they sure as hell aren't all the same.

    10. Re:I have a saying by Anonymous Coward · · Score: 0

      Why do you assume that the client will have python installed? We are talking windows here.

      OTH there are tools to produce executatbles from .py, but I don't think they will be stand-alone, which was what the OP was asking for.

    11. Re:I have a saying by foxylad · · Score: 1
      Simple!
      • sudo apt-get install python

      Oh wait...

      • Go to python.org and download the Windows installer
      • Find the download directory and double-click on the installer
      • Click "Yes I really do want to do this"
      • Click "Yes I really do want to do this"
      • Click "Yes I really do want to do this"... you get the picture
      • Reboot

      I can't believe that Windows still doesn't have the equivalent of software repositories/app store. Why do people still use this broken thing?

      --
      Do as you would be done to.
    12. Re:I have a saying by Anonymous Coward · · Score: 0

      if the .py file is associated with python

      I think you've found your complexity right there

    13. Re:I have a saying by Elshar · · Score: 1

      Should be modded -1 flamebait.

      There's two problems with your argument. First of all, it's quite obvious that the environment is windows, and the guy is using a dos batch file to call os-specific things to do stuff. He'd have to re-write the whole script anyways in order to use linux. The other problem is that he really doesn't need to use python. Or perl. Or lua. Or whatever other random scripty bits we'd use in *nix land. Because, get this, it's not *nix land he's working with. It's windows.

      I'm not really understanding these people who are trying to get him to complicate his "project" by adding scripting/programming languages, or arguing that he should switch his infrastructure over to linux (debian-based in your particular case, I assume). Just write the damn batch script in a KISS fashion, and as long as it works, he's set.

      I'd be saying the same thing if someone wrote a batch script for ubuntu (specifically), and people were saying "Hey, you should use OSX/Windows/SuSe/FreeBSD". Although I'm sure that 3/4 of those I just listed would work with very little if any modification.

    14. Re:I have a saying by Anonymous Coward · · Score: 0

      There's always tools that convert a python script into a Windows executable...a quick search turned up this. Similar tools exist for packaging other scripting languages, including batch files. You can even package Java apps as exes without requiring an installed VM, though he'd probably get some grief for distributing a 50m executable that could've been written as a 10k batch file.

    15. Re:I have a saying by Bigjeff5 · · Score: 2, Insightful

      Batch scripts are for very simple operations - it's literally just command line commands all at once (rather in order, as though they were one command). All of the methods implemented in batch are actually implemented in the DOS command prompt, the script just executes it as though you had punched it into a command prompt.

      What this means is, if you've been using DOS for a very long time, and know the commands and syntax backwards and forwards, there is no simpler tool on the planet for a job a batch script can handle than a batch script. It is virtually 1:1 for entering commands into a command prompt. It has very minor extended functionality, which is what makes it so doggone easy to use.

      As you've pointed out, there are a number of things batch cannot do, for exactly the reasons I gave for its ease of use. But, if a batch program does what you need, why in god's name would you use anything more complicated than that?

      I actually ask questions at interviews to try to find people with your philosophy and weed them out.

      And you're a fool for doing so, particularly because you don't understand the GP's philosophy at all. He's applying basic engineering concepts, like Keep It Stupid Simple, and you're weeding him out because he doesn't use whichever useless design paradigm flavor of the month you prefer.

      The fact that you'd rather he write a whole complicated program to do the job instead of a simple script, without knowing how such an app is going to be used by his customers, just screams idiot to me. More complicated is never, ever better. Assuming you can do the exact same thing with something simpler, at the very least you've wasted time and effort by choosing the more complicated option. I don't know who told you batch scripts were hard to maintain, there is literally nothing to maintain. They are command line commands. If it works in the command line it works in the batch script. /? is your friend, and a lot more helpful than anything you'll get in even the best IDE's.

      That said, depending on who the customer is (he could be using corporate speak for individuals within his company, we use the term as well), and how often they would want to use this, an application could be warranted. If his customers are regular-joe consumers, they're probably not going to use the app at all, in which case you're probably leaving the tool for PC repair folks, so a batch script is a really good idea. The repair guy will be able to tell immediately what the script does and understand what information it's giving him. If your customer is some other department in your company whose end users may or may not need to run it often, then I'd build a simple app to do the job.

      Basically, if it's for the IT guys, the script is more helpful. If it's for the end users, an app looks much more professional. There are various options between scripts and apps that you can use depending on how much effort this warrants.

      --
      Security is mostly a superstition... Avoiding danger is no safer in the long run than outright exposure. - Helen Keller
    16. Re:I have a saying by Mr.+Underbridge · · Score: 1

      I'm not really understanding these people who are trying to get him to complicate his "project" by adding scripting/programming languages, or arguing that he should switch his infrastructure over to linux (debian-based in your particular case, I assume). Just write the damn batch script in a KISS fashion, and as long as it works, he's set.

      Well, I think the whole thing started when he, you know, *asked slashdot* for alternatives.

      It's not like we called the guy up to offer unsolicited advice, for fuck's sake.

    17. Re:I have a saying by Vellmont · · Score: 1


      But all of them add a level of complexity to this that the batch file doesn't have. Which leads me to my second saying:

      Somehow I don't think a bat file that accepts user input for a few options, sends PCL to printers, and generates a web page would really fit into anyones definition of "simple".

      You talk about the added complexity of using a real language, but don't count how much simpler you can actually make the code because of it.

      --
      AccountKiller
    18. Re:I have a saying by foxylad · · Score: 1

      I'll settle for off-topic ;) There are two reasons I'd recommend Python over the existing DOS solution. Number one (by a long way) is maintainability - DOS batch files are relatively opaque (and I'd discount Perl for the same reason). Number two is that python is a cross platform solution - who knows when the PC he's running this on will get replaced with a Mac or linux machine.

      --
      Do as you would be done to.
    19. Re:I have a saying by Rob+Kaper · · Score: 1

      Indeed. Any scripting language will work for such tasks, from shell to Python to Perl to PHP... asker should just pick what he's most comfortable with and preferable what's already being used so he can use some shared libraries for database access (if necessary) or e-mail formatting.

    20. Re:I have a saying by Jaime2 · · Score: 1

      But, if a batch program does what you need, why in god's name would you use anything more complicated than that?

      Because I've seen people push batch files way futher than they were ever intended to be pushed. Most of the time, a horrendously complicated batch file can be re-implemented as a fairly simple script in almost any scripting language. It's stupid to do it in batch, but it works. This is exactly the case where "it works" isn't good enough.

      I don't know who told you batch scripts were hard to maintain, there is literally nothing to maintain

      Any batch file that is more sophisticated than a handful of external program calls will become difficult to maintain. As soon as you start adding menu choices, calls to other batch files, iteration, or error trapping logic, batch files get ugly.

      Basically, if it's for the IT guys, the script is more helpful. If it's for the end users, an app looks much more professional. There are various options between scripts and apps that you can use depending on how much effort this warrants.

      Yes, there are options between batch scripts and apps, like scripts in real scripting languages. Perl, Python, PowerShell, VBScript, KiX, AutoIT, and bash are all much more powerful than DOS batch and don't add a lot of complicated process or opacity.

      For example, write a DOS batch script that pings all of the IPs on a subnet and emails the results. It can be done in DOS batch, but it would be suicide. It is trivial in a real scripting language.

      you don't understand the GP's philosophy at all. He's applying basic engineering concepts, like Keep It Stupid Simple, and you're weeding him out because he doesn't use whichever useless design paradigm flavor of the month you prefer

      Nope, I'm weeding him out because he doesn't value readability and maintainability over functionality. DOS batch is only more readable in the most trivial cases. For those same cases, every other scripting language is identically easy to read (except VBScript which, for some reason, makes it non-trivial to shell out to another program).

  28. If .bat will do it, stick with .bat! by Anonymous+Freak · · Score: 5, Insightful

    PowerShell is the new Batch File Scripting, so if you need more power, learn PowerShell and use that. (I am assuming you're in a Windows environment where change of OS isn't an option.)

    But DOS batch files still work just fine. In my last job at $major-hardware-vendor, we used DOS batch file-based menus all the time; because they were simple, they got the job done, and all the people who had any need to maintain them knew all about them. Some were particularly large/gnarly batch files, too. (Think 3 KB of one single .bat file menuing to do a few dozen tasks.) When choice is used liberally, along with variables, you can make it very simple to maintain, too. (We used it for updating various things, and the very first section was where all the variables were set, all you had to do when it came time to update was throw the updated file in the right place, and change a number in the batch file.)

    --
    Another non-functioning site was "uncertainty.microsoft.com."
    The purpose of that site was not known.
    1. Re:If .bat will do it, stick with .bat! by maxume · · Score: 1

      The people who make combofix have raised the bar for gnarly batch files. The exe is just a launcher and compressed blob of files. Inside the blob, there is more than 1 megabyte of batch files (a lot of it is just lists of files to check, but still).

      --
      Nerd rage is the funniest rage.
    2. Re:If .bat will do it, stick with .bat! by Jaime2 · · Score: 2, Interesting

      But DOS batch files still work just fine.

      I've found that UAC in Vista and Windows 7 hate batch files. Some of my old processes that are still batch file based fail silently on new operating systems. Suck it up and move into the 1990's at least.

    3. Re:If .bat will do it, stick with .bat! by jsepeta · · Score: 1

      I concur. Why add extra levels of hassle if the .BAT does the job you need? K.I.S.S. is a terrible band, but a great acronym to follow when developing solutions that other people will be using.

      however, DOS batch commands aren't very 1990's. they're more 1980's.

      --
      Remember kids, if you're not paying for the service, YOU ARE THE PRODUCT THAT IS BEING SOLD.
    4. Re:If .bat will do it, stick with .bat! by roc97007 · · Score: 1

      Wouldn't that be %major-hardware-vendor%? Or %major-~1~dor%?

      --
      Oliver's law of assumed responsibility: If you're seen fixing it, you will be blamed for breaking it.
    5. Re:If .bat will do it, stick with .bat! by Anonymous Coward · · Score: 0

      Considering even Microsoft still uses batch files for MSVC10 console, this isn't true at all.

      I suspect what's happening is that the scripts would have failed before, except before you were running them with admin rights.

      Batch (and Powershell) has no method to invoke shell elevation at runtime, so commands -- and process execution for apps with a RunAsAdministrator manifest -- will fail without warning.

    6. Re:If .bat will do it, stick with .bat! by Jaime2 · · Score: 1

      Of course I was running them with administrator rights, the whole point of these scripts is to copy files to the Program Files directory. UAC hates this, but it is my requirement. I spend a lot of time going through the following process -- Install OS, Install .Net Framework, Copy 50GB or so of files. I do this to refresh lab computers for week long training sessions. I do it at least a thousand times a year. Until Vista, I was very happy using batch files. After Vista, it's a pain in the butt with batch files.

    7. Re:If .bat will do it, stick with .bat! by PRMan · · Score: 1

      You should try Clonezilla. It's like old pre-Norton Ghost. Mix in a little Sysprep and you'll really speed up your lab builds.

      --
      Peter predicted that you would "deliberately forget" creation 2000 years ago...
    8. Re:If .bat will do it, stick with .bat! by Jaime2 · · Score: 1

      ...and make image maintenance a nightmare. Right now, I have 2 base OS images at about 2GB each and 3TB of virtual machine files for labs. If I switched from copying VM files to imaging an entire OS with VMs, I'd have 3TB of OS images. Today, if I change a hardware platform or want to get current with service packs, it takes me a few hours. If I switched to pure imaging, I'd have to redo all 3TB of images.

    9. Re:If .bat will do it, stick with .bat! by Anonymous+Freak · · Score: 1

      So... What is it you need to copy on a regular basis; and why does it need to be in the Program Files directory?

      There is no excuse for proper file storage. You don't store VMs on your Linux box in /bin, do you? Hell, you shouldn't even be storing them in /usr/bin, for that matter.

      Stick your VM files in C:\Users (or C:\Documents and Settings, as the case may be,) or in a new root-level folder. Don't muck around with putting data files in "protected" folders.

      --
      Another non-functioning site was "uncertainty.microsoft.com."
      The purpose of that site was not known.
  29. Use 'real' shells by chipperdog · · Score: 1

    I recommend bash or csh..

    1. Re:Use 'real' shells by MichaelSmith · · Score: 1

      Or just the distributed version of DOS. I think it is called DDOS.

    2. Re:Use 'real' shells by Bigjeff5 · · Score: 0, Troll

      Ah yes, and how is he going to run those scripts on his customers machines?

      Idiot.

      --
      Security is mostly a superstition... Avoiding danger is no safer in the long run than outright exposure. - Helen Keller
  30. Assuming nobody is whining... by fuzzyfuzzyfungus · · Score: 4, Insightful

    Why would you consider messing with something that works?

    Your description suggests that, for anybody who doesn't really want to get their hands dirty, there is an adequate if rather retro menu driven interface. Great. A little reading never hurt anybody important.

    Even better, if your application is written within the limitations of CMD batch files, it'll be trivial for any admin who cares and has a copy of notepad to pick it apart, if needed.

    I, for one, fucking hate shiny-but-opaque vendor tools("Oh, great, you made it so easy that a trained monkey could do it, once. I need to do it 10,000 times, I see that your only officially supported method is '10,000 trained monkeys'. Would it have killed you to include some useful command-line options?". If your application is "send PCL test commands to networked printers" you ain't selling to grandma and cousin jim-bob. You may well be dealing with somebody who might need to programmatically test dozens or hundreds of printers. He will appreciate being able to rework your tool.

    CMD sucks; but it ships with every version of Windows since ever, and(since you've already written your application) apparently its limitations didn't cripple you. Why mess with it?

    1. Re:Assuming nobody is whining... by Anonymous Coward · · Score: 0

      Actually.. cmd did not ship with every version of windows. Only since Windows 95. Prior to that, you required DOS, and DOS equivalent was command.com.

    2. Re:Assuming nobody is whining... by X3J11 · · Score: 2, Informative

      Actually.. cmd did not ship with every version of windows. Only since Windows 95. Prior to that, you required DOS, and DOS equivalent was command.com.

      Actually.. cmd did not ship with Windows 95. Only Windows NT got the native cmd.exe, which was compatible with command.com anyway.

      Make sure you're right when you're trying to correct someone else.

    3. Re:Assuming nobody is whining... by Bigjeff5 · · Score: 1

      I've found CMD to be surprisingly flexible and it always has great help info. So long as all you need to do are execute some commands in various ways, batch files are hard to beat.

      I find it's particularly good at dealing with several external programs and making them do what you want. I work 14 day shifts, and at least once a shift I'm writing a for /f loop for one thing or another, even if it's just in the command prompt.

      --
      Security is mostly a superstition... Avoiding danger is no safer in the long run than outright exposure. - Helen Keller
    4. Re:Assuming nobody is whining... by bynary · · Score: 1

      Your ideas are intriguing to me, and I would like to subscribe to your newsletter. No seriously, mod this guy +10 Insightful.

      --
      http://www.bynarystudio.com
  31. Another vote for Powershell... by vistapwns · · Score: 0

    Very powerful and clean language, it's installed by default on Windows 7, but you'll have to download for older Windows versions. Or if downloading/installing isn't an option for older OSes, there's vbscript...

    --
    "...I think the Microsoft hatred is a disease." - Linus Torvalds
  32. More Details by clinko · · Score: 1

    I don't think you will get good feedback unless you explain the following:

    (1) be simple - To your users? Is your current UI simple enough for them? Tip: If you know your user's names, you're the real interface.
    (2) be easy to update - Over a network or sneakernet? Do you have Admin rights? A central server?
    (3) be able to send PCL commands to LAN-attached printers - Seems detailed enough. Firewall might be a problem.
    (4) allow email feedback - Again, What's your firewall situation? POP/etc gets blocked a lot if they're (the app) is the "server".

    Not gripes, just helpful to know if you want answers.

    1. Re:More Details by pclminion · · Score: 1

      (3) be able to send PCL commands to LAN-attached printers - Seems detailed enough. Firewall might be a problem.

      I don't see why it would be, since PCL is what is typically sent to those printers normally.

  33. You're serious.... by Anonymous Coward · · Score: 0, Interesting

    ... a DOS batch file was your *FIRST* thought?

    Wow... just, wow.

    1. Re:You're serious.... by Tolkien · · Score: 1

      I've been programming to any degree you're free to interpret for over 18 years and I'm 28. Sometimes when you just want to bang out something simple, it's common to revert to that which is best ingrained (like the stuff you used when you first started) it's only natural. You do it and you aren't even aware of it, everyone does. Belittling those that are at least intelligent enough to ask the question he asks only makes you look worst, anon.

    2. Re:You're serious.... by MaskedSlacker · · Score: 1

      You were modded flamebait but...I mean, come one, we were ALL thinking it.

  34. Batch works out of the box by Anonymous Coward · · Score: 0

    I love my batch files in my domain, they dont get flagged by Antivirus or spyware programs like some of my vbs scripts. Work out of the box and dont require extra software to be installed.....

  35. Perl, Python, or Ruby... by Improv · · Score: 1

    You *could* keep using batch files, but you're missing out on the ability to really structure your code, you're missing out on nice libraries that can handle some stuff you'd otherwise need to write yourself, and you lose the ability to easily do reasonable data manipulation. I was initially inclined to just suggest Perl (it's what I use), but really any of the three would be just fine. Batch file programming is too limiting - I'm sure you have at least some inclinations towards this as you're asking /.

    --
    For every problem, there is at least one solution that is simple, neat, and wrong.
  36. Cruise Control and continuous build systems by Midnight+Thunder · · Score: 1, Offtopic

    For automated development tasks I would go with "continuous build systems", such as Cruise Control (I mention it since I use this). Cruise Control comes in both Java and .Net varieties. The best thing to do is to decide what sort of development environment you have and choose the best tools to support them. I can't say how well Cruise will fit into an environment where C/C++ is the intended language, so if anyone has alternatives to suggest please mention them.

    While I do mention these are target for building applications, many of these solutions include support for the unit testing phase of your projects.

    --
    Jumpstart the tartan drive.
  37. If you do use VB... by transporter_ii · · Score: 4, Informative

    Did some quick research on it and it does look like it would work. But I did find this information:

    http://www.tek-tips.com/viewthread.cfm?qid=655463&page=6

    But here's the problem.... usually, when you use the printer object in VB to print with, it puts MORE PCL code round what you send (or PostScript, depending on the driver you use) and that messes the whole thing up.

    So one of my colleagues found a reference at MicroSoft on how to do what they call Raw Printng, which is direct to the printer not thru' the driver. We experimented with it and it does work. Here's the url: http://support.microsoft.com/support/kb/articles/Q154/0/78.asp

    --
    Doctors destroy health, lawyers destroy justice, universities destroy knowledge, religion destroys spirituality
    1. Re:If you do use VB... by Anonymous Coward · · Score: 0

      I'm the coward who posted the question. I'm printing by simply creating a .txt file on the fily that contains the raw PCL commands and then I just lpr it to the printer. I am enjoying reading the posts, and have pretty much decided to still go with DOS, but I wish I could get an ansi.sys replacement that would work under the cmd shell.

    2. Re:If you do use VB... by rand200069 · · Score: 1

      If these are all network printers that support PCL, there is no need to bother going through a driver or using any of the OS printing calls. You can simply use your scripting language of choice to open up a network connection on port 9100 and dump your own PCL code right to the port. The printer will interpret the PCL code natively and you're good to go.

  38. Re:If It Works, It Works But Remember Your Custome by NatasRevol · · Score: 1

    Wizard????

    Did you see the freaking subject, much less the summary?

    --
    There are two types of people in the world: Those who crave closure
  39. Consider WSH if you want a simple web GUI by wiredlogic · · Score: 2, Interesting

    You could consider VB Script and HTML wrapped into a WSH file if you want a simple web GUI and being locked to IE isn't a problem.

    --
    I am becoming gerund, destroyer of verbs.
    1. Re:Consider WSH if you want a simple web GUI by Anonymous Coward · · Score: 0

      WSH is hell. The documentation isn't just incomplete, it is wrong. There are many features that have been half implemented and are broken in ways that make them unusable. Of course you can only know what's terminally broken after you spend large amounts of time chasing numeric error messages that make no sense at all.

      If you are looking to learn new and creative ways to use office supplies to kill yourself then wsh is worth getting into. Otherwise, just stay the hell away from it.

    2. Re:Consider WSH if you want a simple web GUI by Bigjeff5 · · Score: 1

      ...and being locked to IE isn't a problem.

      It won't be, since any computer that can run DOS batch commands comes with IE.

      --
      Security is mostly a superstition... Avoiding danger is no safer in the long run than outright exposure. - Helen Keller
    3. Re:Consider WSH if you want a simple web GUI by Anonymous Coward · · Score: 0

      ...and being locked to IE isn't a problem.

      Aahh-ha-ha-ha-ha!

  40. Re:If It Works, It Works But Remember Your Custome by h4rr4r · · Score: 1

    A wizard?

    are you out of your fucking mind?

  41. Dont take my stappler. by TiggertheMad · · Score: 2, Funny

    I am working on a project that would allow our customers to test our sending different PCL commands to LAN printers.

    I will be looking forward to the first error is encountered by a user. You will hear someone in the cubical farm say, "PCL PC Load letter? What the fuck is PCL PC Load letter?!?"

    --

    HA! I just wasted some of your bandwidth with a frivolous sig!
    1. Re:Dont take my stappler. by MaskedSlacker · · Score: 1

      "PCL PC Load letter? What the fuck is PCL PC Load letter?!?"

      It's where they file the TPS reports.

  42. Others have already said it by jayhawk88 · · Score: 1

    But yeah, go buy yourself a good Powershell book. Assuming your environment is running XP at least, pushing out support for it is pretty much just an MSI install. Week or two playing around with it, and chances are you'll have a script that runs circles around your old one.

    1. Re:Others have already said it by Bigjeff5 · · Score: 1

      Assuming your environment is running XP at least, pushing out support for it is pretty much just an MSI install.

      He didn't say who would actually be using the script, so that may not be an option. If it is, go for it, but how is it any better than a DOS batch script if the batch script works fine?

      --
      Security is mostly a superstition... Avoiding danger is no safer in the long run than outright exposure. - Helen Keller
  43. .Net and Silverlight by eulernet · · Score: 1, Funny

    As you seem to be a MS fan, I can't believe you didn't consider dotNet languages and Silverlight.

    My personal favorite is VB.Net.
    Massive executables are the best way to show that your tool is of professional quality.

    Silverlight is of course necessary for any kind of interface.
    If you want to avoid a Web interface, use XAML.

    Hey, we are in 2010 !

  44. Autohotkey by gad_zuki! · · Score: 2, Interesting

    I guess everyone has their favorite scripting language and I'm sure Powershell is awesome, but it came 10 years too late. I'm personally fond of Autohotkey. Its a decent scripting language, has lots of handy built in functions, and is easy to pick up, especially for those of us who don't code everyday. I'm always a little surprised at how much it can do. I've used it to manipulate installers with no command line options by using the built in functions to grab the GUI window, press buttons, etc. Most everything it can't do I can do in Windows by putting the unixutils on a share and just calling them via the script. Granted, its a work-around but it works for me.

    1. Re:Autohotkey by Krishnoid · · Score: 1

      Its a decent scripting language, has lots of handy built in functions, and is easy to pick up, especially for those of us who don't code everyday.

      My experience leads me to back it strongly -- I've pressed it into production use to avoid learning a new API for a one-shot data conversion. Its scripting language/libraries fall short of being completely general-purpose, but were still fairly complete, and its flexibility really comes through when I've applied it to shorter automation projects as well as in a single startup script that implements a system-wide clipboard stack and adds hotkeys to various applications -- e.g., adding a Ctrl-q accelerator where it's missing on a per-application basis. Absolutely something to add to your toolbox.

  45. DOS vs PERL by interval1066 · · Score: 1

    I've been surprised more than once by the "richness" of DOS commands and options and what not, but it still blow chunks for not treating stdio and that ilk like as a file ala Unix and family, and getting user input for those interactive moments is impossible without resorting to tricks or a com objects or a simple cmd line app. Simply installing a perl interpreter takes care of all this and more. You could even install cygwin and have some measure of sanity in your testing.

    --
    Python: 'And then suddenly you have a language which says "we're all stuck with whatever the whiniest coder wants".'
    1. Re:DOS vs PERL by MightyMartian · · Score: 1

      Batch files are the lowest common denominator for a fairly large percentage of computers out there. The reason I often stick with them and VBScript is not because they're any damned good (they're not, batch files and VBScript are both crap for different reasons) but simply because I can pretty much guarantee they'll run on any Windows machine built in the last decade. I'm working on a network that has a mix of XP, Vista, Server 2003 and yes, one Windows 2000 machine, and despite their obvious limitations, I know with reasonable certainty that keeping my login scripts and various other utility scripts in CMD.EXE batch and VBScript means I have little or nothing to worry about in the way of dependencies.

      It's the reason I try to keep to fairly vanilla shell and Perl scripts on my *nix boxes, and avoid where I can going for more advanced features, simply because it too represents an LCM, and when you're dealing with heterogeneous networks, you need to consider portability.

      Another underlying principle is KISS. If a batch script does the job, why go further? Is it necessary to install ActivePerl if you're just doing some basic menu processing? There's nothing inherently wrong with using the tools available to you, providing they work reasonably well and are reasonably supportable. I've seen too many guys get on the complicated-but-cool bus and end up with insanely complicated dependencies for basic scripting.

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
    2. Re:DOS vs PERL by interval1066 · · Score: 1

      Then your testing must be extremely simple. The testing I do usually requires some measure of user input, i/o and file processing, regular expressions, and as such batch is not up to that task. I often just install cygwin and I'm done; all the tools I need. If I see a lot of engineers who are chasing their tails I usually think A) wrong engineers, or B) Maybe their employer doesn't know what he/she wants and is giving bad direction.

      --
      Python: 'And then suddenly you have a language which says "we're all stuck with whatever the whiniest coder wants".'
  46. Re:If It Works, It Works But Remember Your Custome by Barny · · Score: 2, Funny

    Wizard? Pfft!

    He needs to re-implement Clippy!

    Think of how helpful this would be :)

    --
    ...
    /me sighs
  47. Powershell or VB Script w/ hta by KevMar · · Score: 5, Informative

    I would also look to Powershell to solve his issue.

    Before Powershell, I would have went with VB Script.

    Because he was wanting a bit more of a GUI, HTA (HTML Application) would be a simple option. It is a local web page named .hta instead of .html and it runs with application security on the local computer. Any script you can put in a .vbs file, you can also put into a script block of a .hta. This is one of those little tricks that not to many people know about.

    I use hta when I want to keep the flexibility of html/script as an alternative to a compiled vb.net app.

    --
    Im a gamer, not a grammer major. This post is full of spelling and grammer mistakes.
    1. Re:Powershell or VB Script w/ hta by FatdogHaiku · · Score: 1

      I'd tend to try powershell also. Plenty of resources here.
      The repository has lots of examples.

      --
      You have the right to remain sentient. If you give up the right to remain sentient, you will be elected to public office
    2. Re:Powershell or VB Script w/ hta by Anonymous Coward · · Score: 0

      Take command is also one alternative:

      http://www.jpsoft.com/tcmddes.htm

    3. Re:Powershell or VB Script w/ hta by Anonymous Coward · · Score: 0

      Powershell huh? Unless you want it to do things quickly. Implementing several functions that are trivial in bash, Python, and Perl, I found that powershell is orders of magnitude slower. For example Python, less then 1 second: powershell = about 15 minutes same task. These were not complicated things...the framework does what it says it will do, but at a cost.

    4. Re:Powershell or VB Script w/ hta by Anonymous Coward · · Score: 0

      Powershell = Microsoft product, the Zune or Vista or Windows ME of shells

  48. lotss of good suggestions by amliebsch · · Score: 1

    But since nobody else mentioned it, let me suggest jscript wrapped in a wsh file. It,s built into windows, is one file and being text can be easily versioned.

    --
    If you don't know where you are going, you will wind up somewhere else.
  49. Easy by gyrogeerloose · · Score: 0, Troll

    Apple Script.

    --
    This ain't rocket surgery.
  50. having worked for by nimbius · · Score: 1

    a multinational printer company that specializes in custom printing solutions for systems both modern and that date 15 years back... i suggest you take a look at BSD or Linux.

    --
    Good people go to bed earlier.
  51. PowerShell + Windows Forms = Happiness! by Anonymous Coward · · Score: 0

    Seriously, investigate PowerShell. I have yet to find a situation where I could not create a solution using this wonderful tool. To take things even further, mix Sapien's PrimalForms IDE and you have slick GUI's running your PowerShell commands!

  52. Ruby + WxRuby + rubyscript2exe by Roadmaster · · Score: 1

    You can whip up a quick GUI with Ruby and WxRuby, and when you're happy with it, create a single executable file with rubyscript2exe. I see two problems: files tend to be large (~10MB) and thus a bit slow to run, but once running they're quite snappy. Ruby is a very easy language and WxRuby is also quite easy to use (not to mention cross-platform but I guess that's not high on your wish list).

    1. Re:Ruby + WxRuby + rubyscript2exe by Jane+Q.+Public · · Score: 1

      The problem there is that rubyscript2exe does not create what I would consider a "real" executable out of your Ruby. What it does (and why it is so large) is that it uncompresses a Ruby runtime and your Ruby script to a temporary directory, and just runs the script. Theoretically, it then deletes the temporary directory on exit, but some versions have had problems with that, leading to your hard drive filling up with thousands of files buried in some obscure temp folders somewhere.

      Also, because of the way it does this, it is not very suitable for a commercial program, because this makes it very easy to capture or save a copy of your raw Ruby code.

    2. Re:Ruby + WxRuby + rubyscript2exe by Bigjeff5 · · Score: 1

      Or, he could do it in VB.net and have a compact and pretty quick executable.

      Seriously, what idiot uses something that bloated for something a 500 byte batch script can do?

      Just stick with the script if the pretty front end is just something nice you're adding on, and is not necessary. Otherwise use VB.net since that's another super easy language, and it's going to be small and quick as snot on any Windows box (which is obviously the target).

      --
      Security is mostly a superstition... Avoiding danger is no safer in the long run than outright exposure. - Helen Keller
  53. Anything. by NitroPye · · Score: 1

    Anything.

  54. Use something open source, for dog sake by Anonymous Coward · · Score: 0

    I cringe at the thought of using a Microsoft tool for this...

    How well is DOS supported these days?
    How well is Visual Basic?

    Use a Microsoft tool, and you are one the second Microsoft dictates that a language or API must die.

    These days all the open source languages support Windows quite well. In fact, Microsoft spends $$$ to help make that so.

    I'd look at Expect or Python.

  55. Shell is most certainly not dead. by Anonymous Coward · · Score: 0

    You would be shocked and appalled at the things I have done with the simple windows shell. Did you know that "FIND.EXE" is the only native commandline tool (that I could find) that can convert a UTF-8 stream into ASCII?
     

  56. DOS no workie on 64 bit by Anonymous Coward · · Score: 1, Interesting

    Just in case someone else doesn't mention it....

    There is no 16 bit DOS subsystem in 64 bit Windows to run said BAT files. So your program will probably have a fairly short shelf life.

    You can run CMD files which are almost the same as BAT files though.

    1. Re:DOS no workie on 64 bit by EvanED · · Score: 1

      There is no 16 bit DOS subsystem in 64 bit Windows to run said BAT files.

      Which would be a real problem if Windows didn't run .bat files in the 32-bit cmd.exe anyway.

    2. Re:DOS no workie on 64 bit by Anonymous Coward · · Score: 0

      How the Hell did this modded interesting? Bat files work fine in 64-bit windows. This 16-bit/DOS nonsense has nothing to do with it.

  57. AutoIt by Sedorox · · Score: 1

    Check into AutoIt (http://www.autoitscript.com/autoit3/index.shtml), we use it at work to do all kinda of stuff. You can do graphical interfaces, and you can even script graphical interfaces. You can have it run different commands with run(), or you can interface with the WinAPI directly.

    If you do decide to work in it, make sure to get the full SciTE editor, the second download link. They include a stripped down version by default, but then install the full version, and it provides many more options.

    I'm honestly surprised I haven't seen this yet on here. It's saved of lots of time (once the coding/debugging was done at least - I can now restore software activation after imaging machines!)

  58. Windows script host? by Anonymous Coward · · Score: 0

    I can't believe no one has mentioned Windows Script Host. I believe it's installed by default on all versions of Windows since Windows 98. It's little bit difficult to explain, but you can write scripts in several different languages; here's a good place to start:

            http://technet.microsoft.com/en-us/library/ee156607.aspx

  59. Tcl/Tk by blavallee · · Score: 1

    I am surprised that nobody mentioned it.

    Tcl/Tk is a scripting language specifically designed for automated testing and software quality assurance.

    http://en.wikipedia.org/wiki/Tcl

  60. Not backward-compatible enough by spywhere · · Score: 1

    Scripting in the 32-bit CMD environment is powerful enough to do all kinds of things well, and it works all the way back to Windows NT 4.0. You can add all kinds of functionality from later versions of Windows and the server OS's by simply throwing the supplementary executables into a folder on the Windows path.

    Bottom line: If a batch file can do it, it's often the best way to do it.

    1. Re:Not backward-compatible enough by Anonymous Coward · · Score: 0

      PS works on XP, which is bottom tier. I doubt many still working with ME or 2k or 98 reads Slashdot.

      I'd sooner write an unmanaged console program before using Batch again. It only takes 5 minutes to add a custom parser for XML. In C++, check out boost::property_tree. Infinitely more flexible than anything Batch offers.

    2. Re:Not backward-compatible enough by RandomFactor · · Score: 1

      This. But if not...PowerShell :-)

      --
      --- Mercutio was right.
    3. Re:Not backward-compatible enough by qubezz · · Score: 1

      Why don't you just move up a pay grade this way:

      ren *.bat *.cmd

  61. Perl/Python/One EXE by donjefe · · Score: 1

    Perl and Python are my favorite. If you want a single file solution, you could use Py2Exe or the Perl Development Kit (not free, but worth the $$$) from ActiveState to compile your script to a single exe, requiring nothing else. I have done this even with Perl scripts using Tk gui's. This allows you to stay in the easy scripting world, and still get the portability of a compiled c++ binary.

  62. Re:Better Alternatives to DOS Batch Files? by EvanED · · Score: 2, Funny

    You can use bash on most Linux implementations

    You're in luck: there is something better than being a trolling twat making useless suggestions. It's called "sticking your head in a vise."

    What you do is get a vise, you put your head in it, and you twist the handle until it contacts both sides of your head. At this point you'll really have to turn the handle hard, but keep going.

    You can stick your head in a vise in most wood shops.

  63. Left out a requirement by DrugCheese · · Score: 1

    Wouldn't it also be required to run on a windows box?

    --
    *DrugCheese rants*
  64. DOS? DOS?? by fishexe · · Score: 1

    ...and even generate a small web page which, when launched from the batch file...

    I don't think those two things belong in the same sentence. Hell, they barely belong in the same century...

    Are DOS Batch files too 1990s to be taken seriously in 2010?

    Hell, DOS Batch files were too 1980s to be taken seriously in 1998.

    Call me crazy but I love DOS.

    Hey, so do I. I love the TRS-80 too, that doesn't mean it's not completely obsolete.

    --
    "I don't care about the Constitution!" --Bill O'Reilly, November 17, 2009
  65. JP Soft 4NT / Take Command by Lowry · · Score: 1

    I haven't used it for ages... but it worked very well..

    http://www.jpsoft.com/

  66. Why? by FellowConspirator · · Score: 0

    DOS batch files were tolerable in the 80's and 90's. Today, you have far more heterogeneous environments (like it or not, about 1 in 5 computers sold is a Mac today, and there's lots of Linux in academic and corporate back offices). Your DOS batch files won't run on them. For that matter, there are now versions of Microsoft Windows that they will no longer run on.

    The world is moving to platform independent options. There's dozens of cross-platform scripting languages that you could use, for example. Most are included with most operating systems, you'd generally only need to supply the interpreter for one platform: Windows.

    The EASIEST way, however, is Java. You can distribute the application by embedding it in a web page. Users will never need to know of batch files or worry which computer they are using (and which OS). It's easy for them, though tricky for you. However, this is just the sort of domain where Java's promise of write once run anywhere has a ring of truth to it.

    1. Re:Why? by EvanED · · Score: 1

      For that matter, there are now versions of Microsoft Windows that they will no longer run on.

      Like what?

  67. A better alternative to DOS batch files? by roc97007 · · Score: 1

    Ummm... just about anything?

    --
    Oliver's law of assumed responsibility: If you're seen fixing it, you will be blamed for breaking it.
  68. Windows - Use Powershell by Anonymous Coward · · Score: 0

    If you are in the windows world, almost everything is being back-ended (AD, Exchange, SCOM, etc...) by PowerShell.
    Learn it now, or learn it later...

    Steve

  69. call me crazy... by Anonymous Coward · · Score: 0

    You are crazy.

  70. +1 Informative by Anonymous Coward · · Score: 0

    These were going to be my points as well.. since I have mod points, modded your comment over making my own. .HTA files are great, very similar workflow to an AIR application (but IE as the engine, which is a mixed blessing) Powershell is a nice alternative as well, you can do GUI via it, but it gets cumbersome. Short of that, VS2010 Express isn't such a bad option.

  71. Python or Javascript by Anonymous Coward · · Score: 0

    If you cannot use Python, which is the best solution in my opinion, then use Javascript.

    Python is open source and in some companies it could be hard to get approval to download and install it. In that case, use Windows Scripting Host to run Javascript code because it is all included. Do not use VB or VBscript because they simply do not have the flexibility and power to do the kinds of string manipulation that you will need for this.

    Also, Javascript is a saleable skillset to have on your CV/Resume.

    You can even put your Javascript code into a .BAT file so nobody will ever suspect what you are doing. http://jimlawless.wordpress.com/2009/08/07/embedding-javascript-in-a-batch-file/

  72. It comes down to requirements by nzNick · · Score: 1

    It depends on your requirements - if you can install other shells such as powershell, perl, java, python .... then pick your poison. If you want to maintain your initial statement of a single file (and here my assumption is that it must run an all windows machines in your network) - DOS works. Why make it pretty ? There is nothing wrong with a simple text menu in DOS - provided it is simple.

  73. size matters by Eth1csGrad1ent · · Score: 3, Funny

    Yeah. VB, C++, Java, they all do PCL commands.

    ..but will it fit on a floppy ??

    1. Re:size matters by Jaruzel · · Score: 1

      VB(6) and C++ will. Java of course wont, seeing as it needs thousands of support files just to do a hello world [1].

      - Jar

      [1] I don't program Java, and have no desire to, as it is a 1990s throwback language. feel free to flame on :)

      --
      Together, We Can Make Slashdot Better. I Do NOT Mod ACs. - Check Me Out
  74. cygwin with bash shell by Anonymous Coward · · Score: 0

    free, easy, capable.

    Python is complete overkill and way too hard to learn and maintain for what the requester asked for. And, it changes versions every week.

  75. But please, call it .BAT, not DOS! by SanityInAnarchy · · Score: 0

    I hate when people make that mistake. It's the Windows NT commandline. Whenever someone sees my bash prompt, they ask me if that's "like DOS", and I have to explain that no, not even close, that it's light-years beyond cmd.exe, which is light-years beyond DOS.

    --
    Don't thank God, thank a doctor!
  76. Re:If It Works, It Works But Remember Your Custome by oatworm · · Score: 1

    Everyone knows that coreutil and man pages are all anyone needs. If grandma can't handle that, she needs to get off the Intervaxenbahn and go home!

  77. Moral of the story by nicknamesarefunny · · Score: 1, Insightful

    Moral of the story.... Never ask slashdotters something which begins like 'Which programming laguage should I use..." Chances are no one cares what the original problem is, but everyone will start bitching about how their 'programming language' is the most elegant one and can solve any problem under the sun! Your program works, is maintainable and does what it is supposed to do. You already are using the best solution! Others may not like it because they may think X programming is the real mans programming language. fcuk them!

  78. Stick with what works. by Anonymous Coward · · Score: 0

    Coming from a windows background and trying to pick up powershell :) My motto whatever works, stick with it. Sometimes it's batch files, sometimes it's powershell or VBScript. I'm trying to force myself to write in Powershell, but the OO concepts are coming slowly. :)

  79. won't some one think of the math? by the_fat_kid · · Score: 1

    So, I either have one monkey per plantation or a million monkey support structure?
    Yikes, maybe I will try perl.

    --
    -- Sig under construction...
  80. BATch files aren't dead yet. by Lime+Green+Bowler · · Score: 1

    I'm using batch files to back up 120+ factory floor machines that run critical processes. The batch files read text files for input of which machines/partitions to back up and what org tree to store them in, makes full and incremental backups that auto-refresh depending on the percentage of data change, emails status/failure dumps and backup summaries, and archives the backups to off-line storage carts for a history. OK, so the backups, cartridge ejection and email functions are EXEs, but the mockup code written in '08 worked too well and is still running today.

    Bonus fugly: a web page is used to update the text files.

    Bitter twist: I'd load Perl in a heartbeat and port the batch files over if it weren't for bullhead company policies that say I can't load it.

  81. raw dog by fatbuttlarry · · Score: 1

    What are you doing specifically with PCL? Could you get away with sending raw commands to your printer(s)?

    Sometimes providing a modern interface doesn't sacrifice customization. An earlier post suggests watching others use the tool to gauge how difficult it is. If you have the time to improve, deliver both and have the user compare. In the end it's the users that decide. As long as .bat/.cmd files are supported in Windows, your solution could be not only the most efficient, but the most desired.

  82. Grumpin by negRo_slim · · Score: 1

    No but now your folder of com files will require a butt load of runtime files on every single workstation. Now personally I would smack it out as a stand alone executable in delphi, but that is just me.

    I know every time I try and run WinNuke on my 98 box I get some sort of crazy MFC file required.

    --
    On the Oregon Cost born and raised, On the beach is where I spent most of my days
  83. Definitely Python by Anonymous Coward · · Score: 0

    I use Python at work for automated testing of embedded systems. It's easy to use and understand, and it works great! It's my scripting language of choice. Plus there is a lot of tutorials and useful info out there on the web. If you're lucky, there is an example script out there. I think you'll get the job done so much faster with Python. And if you need a simple GUI, the wxPython package gets the job done. That's what I recommend.
    Windows batch files are dated. Most I use them for is calling python.exe and passing the script name I want to run. But you can also create an EXE for standalone distribution using pyinstaller if you need too.
    Oh and if you do try Python, learn the logging module right away. It'll help a lot with debugging stuff and its pretty flexible.

  84. NUnit, FitNesse by kootsoop · · Score: 1

    1. For unit tests, you can't go past NUnit or CPPUnit and the like. 2. For scripted stuff, I highly recommend FitNesse. It's a wiki-based scripting language that allows "fixtures" to be written to tie into your code.

    --
    "Engineering is the art of making what you want from things you can get" - Jerry Avins
  85. 100% HTA by holophrastic · · Score: 1

    You get just about any scripting language you like -- javascript, jscript, vb script, even perl script. You get to control the chrome, and dodge security problems. You get a full HTML rendering engine of IE, you get all of the windows API including the file system, ODBC, microsoft office files, any peripherals you like, and all of activex. you get a networking system too. you also get the registry and powershell in any of those scripts. you don't need to generate a web page, you just are a web page. That includes anything IE can do -- flash, video, images, directx, and more.

    oh and hta's can be run directly from the web if you like, so you don't need to distribute updates at all if you don't want to. they can access local and remote and online resources interchangeably.

  86. PowerShell by Anonymous Coward · · Score: 0

    Try PowerShell. It works well with dos batch files too, if for any reason you need to keep some stuff in batch files. The only gotcha I have found is keeping environment variables set from the batch file, but this is easy to remedy. We are very friendly in #powershell on irc.freenode.net and tend to answer questions pretty quickly unlike several other irc channels I frequent. We have user groups, meetings, and I have even heard stories about pizza.

  87. Re:If It Works, It Works But Remember Your Custome by nacturation · · Score: 1

    A wizard?

    are you out of your fucking mind?

    How else are you going to get a robe and wizard hat?

    --
    Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
  88. Associated with what by tepples · · Score: 1

    What complexity does python add (for instance)? From the user's standpoint, if the .py file is associated with python (and it will be)

    Is it associated with Python 2, with Python 3, or with "Windows does not know how to open files of this type. Do you want to look up the type in Microsoft's useless database?"

  89. Windows Scripting by David_Hart · · Score: 1

    I haven't done this in a while. I know that Powershell can do a lot of things, but I believe that VBScript + HTA or Perl (Activestate Perl) are much more powerfull for what you want to do. Both would allow you to create simple GUI prompts for your users without having to write a lot of code. Powershell, as I understand it, is more for systems administration than for generic scripting.

    If your users are okay with the DOS program, why change?

    If, as I did for several of my DOS programs, you want to use this as a learning opportunity to teach yourself a more powerfull and flexible scripting platform, then go for it. In fact, if you have the time, I would suggest you write it in both VBScript and Perl so that you have a better understanding of both environments. You'll then be able to pick and choose the scripting environment, depending on what functionality you are looking for. I've always believed in picking the right tool for the right job and each has their strengths and weaknesses.

    David

  90. Re:DOS? DOS?? by Bigjeff5 · · Score: 1

    When he says "DOS batch files" he means the batch format that is still compatible with the 16 bit subsystem. Those don't become obsolete until everyone is running 64 bit and then, just change all your scripts to .cmd and magically they work again!

    Seriously, you have no fucking clue what you're talking about. A windows batch file is just a collection of windows commands, so unless Windows 7 is suddenly obsolete, the commands he's scripting aren't obsolete either.

    In fact, those old DOS commands aren't even deprecated yet, and only with Windows 7 is a suitable replacement for command.com being shipped with Windows. With 7 he can now expect to be able to run a powershell script on anybody's machine (so long as they run 7). That wasn't possible before, particularly if he didn't have the ability to install powershell before hand.

    You're an idiot, you have no idea what "obsolete" means.

    --
    Security is mostly a superstition... Avoiding danger is no safer in the long run than outright exposure. - Helen Keller
  91. Re:Better Alternatives to DOS Batch Files? by Bigjeff5 · · Score: 1

    Lol

    --
    Security is mostly a superstition... Avoiding danger is no safer in the long run than outright exposure. - Helen Keller
  92. Re:If It Works, It Works But Remember Your Custome by karnal · · Score: 1
    --
    Karnal
  93. This question is clearly a joke or... by erikvcl · · Score: 0, Troll

    posted by someone who traveled to 2010 directly from 1992.

    I can't believe how many "serious" answers this post has received -- or how it was accepted to the front page of Slashdot!

  94. PHP and WinBinder by frizzantik · · Score: 1
  95. Why hasn't anyone suggested LabVIEW? by ekerry · · Score: 1

    A lot of people use LabVIEW for test applications because it makes talking to a bunch of different hardware really easy.

    1. Re:Why hasn't anyone suggested LabVIEW? by zachary.grafton · · Score: 1

      Price maybe? Batch files are free...

  96. LabVIEW by CaptainPhoton · · Score: 2, Informative

    Most electronics companies where I've worked or consulted use LabVIEW for automated product testing.

    You can download an eval copy from http://www.ni.com/labview/optin/trylabview

    LabVIEW is graphical programming. I'm still loyal to C/C++, but all those text languages are so 20th century! ;) Until we achieve natural language programming, LabVIEW is as good as it gets for 21st century.

    Putting humor aside, LabVIEW apps are very simple to write and deploy. The Application Builder allows you to create an EXE from your app and bundle it with the runtime in a nice Windows installer that you can send to your customers.

    I've seen some suggestions on here for PowerShell. One limitation of DOS batch files is the inability to interact directly with .NET. Anyone on modern Windows should learn .NET since it is the preferred framework now for that OS. PowerShell can give you the .NET access, but LabVIEW will have a much quicker learning curve if you ever have the urge to delve into .NET.

    The LabVIEW forums are very active, and the community gurus provide quick turnaround on support questions. For long-term maintenance of your test app, you're likely to find more engineers in the Test&Measurement arena that use LabVIEW versus DOS.

    Good luck in your choices!

  97. CMD considered harmful by malloc · · Score: 1

    Even better, if your application is written within the limitations of CMD batch files, it'll be trivial for any admin who cares and has a copy of notepad to pick it apart, if needed.

    I've spent years of my working life writing and maintaining batch files, from synchronizing multi-threaded jobs to the polymorphic (you realize cmd.exe stores the next command as a byte offset into whatever is on disk when it goes to read at that offset?). It's true cmd.exe is ubiquitous and easy to modify at first, but "within the limitations of CMD" will come back to bite you.

    Version one:

    if "%var%" == "false" goto endif_var
        echo Something
        call :something :endif_var

    Version two ("hey, cmd has multi-line if statements!"):

    if "%var%" == "false" (
        echo Something
        call :something
    )

    Version three ("this looks simple to understand, let me modify it"):

    if "%var%" == "false" (
        echo Something
        rem something else because something is borked
        call :somethingelse
    )

    Wham! Innocent admin can't figure out what the heck happened to the batch file, it doesn't work any more.
    One day he may realize that his statement was turned into:

    if "%var%" == "false" ( echo Something & rem something else because something is borked & do somethingelse )

    The innocent comment killed everything after it.

    CMD sucks

    You said it.

    -Malloc

    --
    ___________________ I want to be free()!
  98. Use a Makefile by descil · · Score: 1

    Since you're doing tests, your tests should have outputs, so use a makefile. This will allow you to test only things that have changed, since makefiles have built-in timestamp checking. For instance, let's say you have a series of ".test" files, and ".output" files, and a command "runtest" that runs your test, you can use a makefile like this:

    TARGETS = one.output two.output three.output

    all: $(TARGETS)
        cat *output > /dev/printer

    %.output: %.test
         runtest $<

    1. Re:Use a Makefile by Anonymous Coward · · Score: 0

      God, and I thought the morons advocating Perl and VB were idiots. You, sir, take the cake. That's got to be the most idiotic misuse of a tool I've ever seem. That even worse that his use of BAT files and ANSI escape sequences to "spruce up" his testing.

    2. Re:Use a Makefile by descil · · Score: 1

      Thanks :D

  99. VBScript anyone? by stormcoder · · Score: 1

    Isn't this what VBScript is for? If you don't like VB you can use JScript.

    --
    Sorry my bullshit sensor overloaded.
  100. Seriously? by dbarclay10 · · Score: 0, Redundant

    Seriously? Really?

    C'mon.
    C'mooon.

    Enough said.

    --

    Barclay family motto:
    Aut agere aut mori.
    (Either action or death.)
  101. LoveDOS by JimWise · · Score: 2, Interesting

    A "friend" of mine used to always stick a copy of LoveDOS on anyone's computer in college that was left unattended. The ending comment of "Call me crazy but I love DOS" brought these "fond" memories back. It looks like someone has actually archived a copy of it, as well as putting together some screen shots and info about it: http://jeff.rainbow-100.com/?p=100 Ever since being inflicted with LoveDOS I have set up every computer I own to use a BIOS password.

  102. REXX by Anonymous Coward · · Score: 0

    If you system supports it, use REXX

  103. Use Python by m2pc · · Score: 1

    I've done a lot of scripting for Windows in Python lately and I must say it's been a pure joy. There'a a TON of APIs and it's very easy to whip up something powerful quickly. You should be able to find an easy way to talk to the LAN printers (via sockets, etc.) and sending email from Python is also a breeze.

  104. We:15 minutes could save you... by Anonymous Coward · · Score: 0

    Does Ewmew Fudd have twouble with the lettew "aw"?

  105. Re:If you do use VB... (Don't do that!) by Will.Woodhull · · Score: 2, Insightful

    Ouch! Last thing needed when distributing printer test code is another wrapper layer that could interfere with printing.

    Except maybe an additional patch to turn off the additional wrapper layer, assuming it actually does that completely, every time no matter what... maybe that is really the last thing needed.

    If .bat files won't do it for you, then you could look into the Windows implementation of Perl, coupled with the Tcl/Tk module, which gives you basic GUI support so you can fancy it up with buttons and input boxes and such. After you've got the script working right, you can run it through Perl2Exe or one of the other available compilers and distribute your work as a .exe file. This has two obvious advantages:

    1. a .exe file looks a helluvalot more impressive than a .bat file
    2. you won't need to worry about someone messing around in your .bat and causing you needless support headaches.

    A very important side effect is that you'd gain a little experience with Perl, which can work scripting wonders that .bat files could never do.

    Sort of a caveat: I once made my living by writing simple perl scripts that pulled data from the text dumps of a legacy MUMPS database and returned .csv files that the QA guys could play with in Excel. So I'm biased. I've also left the Microsoft ecosystem for Linux, since I think the Microsoft ecosystem is terminally polluted on its own effluvium. So I'm really, really biased. (Perl is FOSS originating in the Unix/Linux world; Perl2Exe is shareware that I remember cost under $50)

    --
    Will
  106. Cygwin Bash by Dunderflute · · Score: 0

    Simple, portable. I use it for everything.

  107. All other scripting languages depend on by korpique · · Score: 1

    ...their interpreters. Powershell isn't as backwards compatible.

    Languages compilable to self-contained executables not installing anything extra on your computer (not a single file) are typically a lot more effort to work with - and the users can't just read the file to find out it's trustworthy to run.

    Only exception to above rules I saw in comments here (pardon me for not linking, htc hero is really hard for this stuff) is the PAR perl exe packager. I'd jump to try that out if I developed for Windows.

    I'd say keep it simple and avoid the colors. They bring extra complications and add no business value.

    I admire your mad batch skills. How do you talk to the printers and send mail without extra dependencies, by having the script write out small com files to run, eh?

    --
    I was the real korpiq until I woke up clowned.
  108. Rex Conn's 4DOS? by Anonymous Coward · · Score: 0

    Does this get around the DOS limitations without losing the DOS-vibe?

    http://www.4dos.info/v4dos.htm

  109. The answer's simple. by Anonymous Coward · · Score: 0

    LabVIEW. Can't go past it for test and measurement. Expensive yes, but amazingly simple!

  110. HTA is a good single file solution by Anonymous Coward · · Score: 0

    There are a lot of good suggestions out there by people that apparently didn't read your full post. Since you are using batch files currently, it's assumed you are using windows ;). If your windows systems have IE 5.5 or higher, a good single file solution would be to use a .hta file. There are quite a few examples out there, and you can have your logic and HTML UI in one file. HTA is the only type of solution that I am aware of outside of batch files that would allow you to only have to deliver a single file to run on most windows systems and not have to install a script interpreter or runtime. For anyone who has written a VB app, you probably know that VB runtime compatibility across diverse systems can be a pain to manage.

    If you have powershell runtime available on the systems already, that would probably be the best solution, and the most "future proof" for windows specific implementation.

  111. TestShell is your solution... by TCDooM · · Score: 1

    There is a product named TestShell written by a company named QualiSystems. it's a visual studio for developing tests without the need of knowledge of a programing language. it's very robust. check it out at: www.qualisystems.com

  112. TakeCommand / TCC by Anonymous Coward · · Score: 0

    I used take command ago for DOS scrips (years ago), and I still use it instead of normal command prompt or power shell. The commercial version seems to support active scripting, but I've personally never tried it. At the moment I'm using the free version of TC as replacement for the normal command prompt / powershell.

    http://www.jpsoft.com/

  113. Re:Python would be my first choice. (IronPython) by Yuioup · · Score: 1

    IronPython would be my first choice. It's excellent.

  114. CMD? by krischik · · Score: 1

    Have you overlooked that apart from Command.COM there is also CMD.EXE? All you have to do is rename your file from .BAT to .CMD and you move up to the area of 32bit computing. And yes CMD's are faster for it.

  115. Re:If you do use VB... (Don't do that!) by xQx · · Score: 1

    Of course, the only downside of this is you would need to learn perl.

    One of the few programming languages that requires you have a Ph.D. to write a 'hello world' script.

  116. Re:perl? The language of choice for readability !! by Anonymous Coward · · Score: 0

    The primary reason I did this was readability.
    Yeah "readability" is *always* the first thing that comes to mind with Perl.

    I can look at them a year later and know exactly what I did and how I did it.
    I don't doubt it. Unfortunately though your COWorkers are still trying to decode your work....

    All I had to do was be a little disciplined about script formatting and variable names (it's really not that hard).
    Indeed as this well disciplined Perl example by Mark Dominus clearly demonstrates:

    @P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
    @p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
    ($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
    close$_}%p;wait until$?;map{/^r/&&}%p;$_=$d[$q];sleep rand(2)if/\S/;print

    Perl - always the language of choice for readability! :)

  117. Re:If you do use VB... (Don't do that!) by chromatic · · Score: 1

    Swap user numbers with me:

    say 'Hello, world!'

  118. Use Visual Basic Scripting by Jack+Schitt · · Score: 1

    Use VBS... it was designed to replace batch files and it can do all of the same stuff. Even more, I recon.

    After all, 100 million script kiddies can't be wrong. Just make sure the user has the ability to tell the printer to STOP printing test pages and that the vbs doesn't automatically copy itself to all other attached computers on the network...

    --
    This message brought to you by Jack Schitt's Previously Shat Shit
  119. Perl by Anonymous Coward · · Score: 0

    Perl.

  120. Umm I dunno... a UNIX shell, perhaps?! by amn108 · · Score: 1

    Just about any UNIX shell, including 'sh' and most of its modern derivatives, is orders of magnitude more powerful than DOS batch file processor.

  121. Does anyone metnioned... by Anonymous Coward · · Score: 0

    PowerShell?

  122. PowerBatch by uncle+slacky · · Score: 1

    I used to use PB for install scripts back in the mid-90s - a sort of extension of DOS batch language that produced executable code. A bit like VB for DOS, come to think of it - you might have a look at that as well: Powerbatch: ftp://garbo.uwasa.fi/pc/batchutil/pwrbt14j.zip VB for DOS: http://www.qbcafe.net/cgi-bin/downloads/download.pl?dlid=capuqWZASbvLM&compiler/qb_compiler=vbdos.zip

    --
    Windows is like the faint smell of piss in a subway: it's there, and there's nothing you can do about it.
  123. Maintainability by c0lo · · Score: 1

    If maintaining the set of DOS batch files doesn't create you nightmares, go for it!
    Might not be a problem at the start, but as they grow in number and complexity... the probability of nightmare approaches 1.
    Besides, if something goes wrong while testing, without the ability to debug/trace the execution, how can you make sure it is the product that's going the wrong way or, instead, your scripts have bugs somewhere?

    --
    Questions raise, answers kill. Raise questions to stay alive.
  124. Use the sharpest tool in your shed by Anonymous Coward · · Score: 0

    Dear Crazy,

    In your hands, perhaps DOS is the best tool for the job. :-)

  125. Anonymous Coward by Anonymous Coward · · Score: 1, Informative

    Use VBScript, not that complicated to pick up by looking at examples and RTM'ing the help file. Then use a HTA to present the interface, and even take feedback inside the HT

    http://technet.microsoft.com/en-us/scriptcenter/dd742317.aspx

    http://www.microsoft.com/downloads/details.aspx?familyid=01592c48-207d-4be1-8a76-1c4099d7bbb9&displaylang=en

  126. Powershell by nhstar · · Score: 1

    Assuming that you're trying this out on OSes newer than Win2k, powershell may make a nice alternative. You can use the same structures that you're familiar with in command and the ability to add more complex components when/if needed.

    --
    --- no sig to see here... move along.
  127. Forget it, there are better alternatives by spedrosa · · Score: 1

    Forget about batch files, unless all they do is launch better tools and nothing else.

    There are many alternatives. You could go with Python, Perl, Powershell or, if you want it really really simple, small and powerful, use Lua. Package it with the app and people won't even notice it's there.

    Plus, you can start it up with an one-line batch file, if you want that nostalgic feeling.

  128. You only need a UI by Anonymous Coward · · Score: 0

    From reading the comment, I see everyone suggesting their favorite scripting language, but I think it misses the point.

    If your script works as you like, then keep it that way, and as others mentionned, just develop a satelite app that handles the parameters of your script and actually launches it. This way everyone is happy, the sysadmin that wants to automate his tests can directly launch your script from his automated tasks, and the user that wants to do a quick test can use the GUI.

    I do agree that providing a UI in DOS can feel quite elderly and doesn't look very professionnal. I mean, use VisualStudio Express (C# or VB) and write your small GUI, you'll see, its pretty simple to use. Then bundle your app with the script, and everything will be fine.

    You can also decide to build the UI from a config XML file that could allow you to easily add new options to your UI for additionnal command line options ( something like ), this could make your app pretty scalable if anybody modifies it, but I think i'm out of the subject, and you probably don't need this ... :o) .

    Good luck with your project !

  129. Re:If you do use VB... (Don't do that!) by Pharmboy · · Score: 1

    One of the few programming languages that requires you have a Ph.D. to write a 'hello world' script.

    print "Hello World";

    WTF could be easier? And with a UID that low, I have to wonder if you bought it off Ebay after you said that.

    --
    Tequila: It's not just for breakfast anymore!
  130. Another vote for Python by Just+Brew+It! · · Score: 2, Informative

    Where I work, we have used Python to create a regression and qualification testing framework for embedded avionics software. It has worked out exceptionally well. The testing framework was originally developed on Windows, but we are also porting it to Linux. (The Python parts are completely portable, of course... but because of the nature of the application we also had to create libraries in C to drive some specialized hardware, and the C modules do require some porting effort.)

  131. Kix anyone? by Anonymous Coward · · Score: 0

    I don't know about anyone else, but i have been using Kixtart (http://www.scriptlogic.com/kixtart/) since the days of Win95 for all my windows scripting needs. It is simple, powerful, intuitive and there are a ton of UDF's that are already out there to do just about anything you could imagine. This allows even a non-scripter to build an application in minutes, package it in a Win32 wrapper and distribute an executable. Piece of cake. Even though development stopped on this a few years back, it is still a very viable alternative

  132. Better than DOS batch? by jandersen · · Score: 1

    I would say that anything is better, at least in terms of expressiveness; even JCL has richer syntax.

    I can understand why you like DOS, in a way - back in the day, I used to know the BIOS and the DOS interrupts by heart. Still, now I use ksh - I wouldn't be surprised if you can get that (or bash, which is a tolerable alternative) for DOS. There is a lot more to learn, but then, of course, it lets you do much more too.

    Oh, and upgrade from DOS - Linux is what DOS aspired to, originally, as evidenced by the old XENIX system.

  133. Focusing on the wrong thing by Anonymous Coward · · Score: 0

    You're focusing on the wrong thing. You don't want simple, you want maintainable. Maintainability is the biggest requirement in automated testing. Simplicity can be a very helpful factor in maintainability, but using a restricted language is a negative factor against maintainability.

    I don't know what other programming language would allow this and be as simple.

    Any programming language. Perl, python, ruby, and powershell are all simple to build and execute and would work well. But it's not like setting up any language to do what you want is that complex.

    Rule #1 of automated testing: Automated testing is software development, just with different challenges.
    Corollary #1: Everything that is helpful for software development is helpful for automated testing.

  134. Re:If It Works, It Works But Remember Your Custome by MikeBabcock · · Score: 1

    Write me an industrial accounting system that is time efficient for data entry and uses some self-documenting interface like a wizard and I'll be impressed.

    When you want your data entered quickly and your data-entry people want to be efficient, you want efficient user interfaces that don't coddle people who've been doing their job for years. You create interfaces that make sense, document them to death and do training.

    Hire an army grunt who memorized "In situation x, hit green triangle twice" over someone who requires a wizard to enter their data any day. One is teachable, the other is not.

    --
    - Michael T. Babcock (Yes, I blog)
  135. Migrate to powershell? by plebeian · · Score: 1

    Having migrated to powershell for all logon scripts in my domain I would suggest thinking about it. A lot of the dos batch functions can easily be ported with minimal fuss. Having not done any object oriented programming, it was a bit of a bear to wrap my head around the changes. Two tips that would have saved me a lot of time: 1. Calls to win32 gui apps run in the background and your script continues with out waiting unless you include a Diagnostic Process wrapper and specify the .waitforexit() method. 2. system.windows.forms are good for gathering user input from people who freak out when they see a "Dos box" (side note, the first focusable element that you add is selected when the form is generated. Most of the PS examples I have seen online do not point this out and have the focus set on something other than the first user input item).

    --
    "I myself am made entirely of flaws, stitched together with good intentions."
  136. Why *reboot*? Perl & Python *do exist* for Win by DrYak · · Score: 1

    This being /. though, I'll have to mention a small customized LiveCD (think DSL sized) with a (perl script | python script | brainfuck implementation | emacs extension | vi/vim script | whatever)

    Why reboot onto a CD ?!?
    Python, Perl, and the likes are all freely available on Windows too.
    Several even features way to pack everything needed (Run-time env + your script + its dependencies) into a single installer or executable.

    I would definitely vote for them as they are widely available language on lots of different platform and each feature huge collection of extensions.

    (As are Visual Studio Express and Monad PowerShell if you deffinitely need a pure Microsoft solution while trading some freedom and portability)

    --
    "Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
  137. Re:DOS? DOS?? by fishexe · · Score: 1

    Seriously, you have no fucking clue what you're talking about. A windows batch file is just a collection of windows commands...

    Yeah, but we were talking about DOS batch files. Feel free to lecture me all day about what he means when he says "DOS batch files", but I'm going to continue to interpret "DOS batch files" to mean "DOS batch files". Ok?

    ...only with Windows 7 is a suitable replacement for command.com being shipped with Windows.

    Um...try cmd.exe? Only been around for, what, 10 years now? You only use command.com for compatibility if you specifically need to run DOS programs from your batch file, which I doubt is the case because if it were, the OP would have said "I need to run DOS programs, help!" instead of "I need to send some messages to printers, is DOS the right approach?"

    You're an idiot, you have no idea what "obsolete" means.

    I may be an idiot, but you're clearly the one who doesn't know what obsolete means, or deprecated for that matter. From wikipedia: "Obsolescence is the state of being which occurs when an object, service or practice is no longer wanted even though it may still be in good working order. Obsolescence frequently occurs because a replacement has become available that is superior in one or more aspects." Since win32 is superior in one or more apsects to DOS, and nobody but OP really uses DOS, I'd say that constitutes obsolescence. The fact that the commands still work in the DOS subsystem has nothing to do with whether they're obsolete. As far as the things you say "aren't deprecated yet", deprecated doesn't mean the commands have been taken out, it means they're only still available for compatibility. Here's a hint: if you have to say "yet" to claim that something's "not deprecated", that means it's already deprecated. Here's another hint: try looking up big words before lecturing others on what said words mean.

    --
    "I don't care about the Constitution!" --Bill O'Reilly, November 17, 2009
  138. RunRev by Anonymous Coward · · Score: 0

    RunRev.Com

    You can get revMedia for free.

    revStudio and revEnterprise for 30 days.

    It uses an xTalk derived language. Very easy to use but very powerful. I use it for everything from Database migrations, to full fledged web-ready client apps.

    Very powerful, very simple.

  139. Take Command Console by Anonymous Coward · · Score: 0

    If you like old DOS commands, probably you'll like Take Command Console from jpsoft. It's a basic and free command processsor derived from 4NT and 4DOS command processor. It comes with with 111 commands, 140 functions and 97 internal variables that allows you to do several tasks with basic batch commands, including IF-Then-Else, DO Loops, Switch, subroutines and enhanced options for shell commands like copy, move, delete. It also supports ANSI color commands.

  140. Re:If It Works, It Works But Remember Your Custome by Locklin · · Score: 1

    That's great for playing a DVD, but absolutely sucks for a complicated task. I see people spending hours clicking around menu-driven software (eg., SPSS, EPrime, Excel) trying to get something to work because they have been trained to never look at documentation (and be afraid of anything that requires typing). /rant

    --
    "Knowledge is the only instrument of production that is not subject to diminishing returns" -Journal of Political Econom
  141. AutoHotKey by Anonymous Coward · · Score: 0

    AutoHotKey is the solution for your problems (http://www.autohotkey.com). You can program all sorts of different applications, compile them into .EXE files, create GUI's (if you want), etc. The programming language is very very intuitive, and it works great. I work for one of the largest IT firms in the world, and we are accomplishing some major things as far as automation is concerned, all using AutoHotKey. It is definetely not your typical macro programming language, it is way, way, way too powreful to be considered that at all. It's basically a full-blown language, and it is incredibly easy and intuitive to use. Try it out I gaurantee you will fall in love with it.

  142. Xautomation by rwa2 · · Score: 1

    Nearest equivalent for X / Linux that I've used is xte, which uses the XTest extension to send keyboard and mouse events to the desktop.
    xte is usually included with the "xautomation" package for various distributions.

    I've also seen people use xvkbd -text to automate keystrokes (often in concert with xbindkeys), but I've found xte works a bit better in many cases, for example, when activating CTRL/ALT/Shift/etc. modifiers.

    To complete the package, xprop can also give you some useful window state information and control so you can find and manipulate application windows.

  143. Re:If you do use VB... (Don't do that!) by Will.Woodhull · · Score: 1

    print "Hello world!\n"

    I don't see how that requires much in the way of higher level education to master.

    Perl is a highly permissive language: it assumes that the programmer knows what he is doing and tries to keep out of his way. It is a lot like contemporary Internet English: in both cases most users are not fluent in the language, let alone capable of writing truly elegant stuff. But in both cases the users are generally proficient enough after a reasonably short period of study to get the language to do what they need. Just as there is a lot of really crappy English language on the Internet, so too are there a lot of really crappy perl scripts out there. But a Brazilian does not have to be able to write perfect English to ask a newsgroup for help with a problem in 3D modeling of turbulent flows. Similarly, a sys admin does not need high level programming skills to write a perl script that would read a dump of the day's network logs and extract all entries from a specific machine.

    --
    Will
  144. Re:If It Works, It Works But Remember Your Custome by Kjella · · Score: 1

    Dude, at work I used to have an application with five commands:

    login [user/pass@server:port]
    logout
    verbose [on|off]
    output [file]
    call [file]

    Still I had to train a guy to use it, not an old geezer but younger than me in his 20s. Everything needs a manual...

    --
    Live today, because you never know what tomorrow brings
  145. Re:If It Works, It Works But Remember Your Custome by Anonymous Coward · · Score: 0

    That's the worst idea I think I have seen in this thread! Lets take something simple like a batch file, and search for a way to make it better. Still simple, but better. Oh wait! I can make a wizard! There is absolutely no complexity involved in that right?!

    Genius.

  146. Re:perl? The language of choice for readability !! by BJ_Covert_Action · · Score: 1

    Yup, because when I said, "disciplined about script formatting and variable names," what I was referring to was the practice of keeping all variables anonymous, not indenting anything, not using proper line breaks, not commenting my code, and loading functions with anonymous inputs that are anonymous outputs from preceding functions.

    Yup, all those practices are, most certainly, what I mean when I say disciplined formatting and variable naming practices. You hit the nail on the head AC!

    /endsarcasm

    (And please don't woosh me, yes I know it was a joke).

  147. Okay... by solid_liq · · Score: 1

    You're crazy!

  148. DOS is not dead (even if it smells that way) by Anonymous Coward · · Score: 0

    Years ago I hacked together a small "boot strap" utility in assembler and compiled it with NASM. It was a self-modifying program that, in its original form, didn't use any non-printable (non-echoable-to-file) characters. Once in memory, it modified itself to provide what printable op-codes couldn't.

    What it did was allow me to echo hex coded strings to files, so a batch file could create the .COM, then use the .COM to create any other file, including binary .EXE files.

    By the time I was finished, I made a "bin2bat.exe" program that created self-extracting batch files.

    I can now do ANYTHING with a batch file that can be done in ANY programming or scripting language (assuming DOS is available). (Hoping to win a case of beer on a bet, I once made a 65 MB batch file that, given a ready DOS prompt and an available hard drive, would install Windows 95. I never got the beer, but it was still fun!)

    When I made the switch to Linux, I still tinkered with script files that would run as both BASH and BAT scripts.

  149. Several approaches depending on platforms by Anonymous Coward · · Score: 0

    These are some suggestions based on the assumption that you are strickly a Windows shop. In order of technology (more "primitive" to more "modern")

    1. Stick with the cmd script, it will run on just about anything though it can be hard to make a batch script which is not brittle and some common tasks are hard to do (lack of coreutils-like tools on Windows)

    2. Use one of the WSH (windows scripting host) languages eg. vbs, js, etc...

    - it is more flexible than batch files (for example try getting the date or time in a batch file, it can be done but simple things are a pain in the arse)
    - it is natively supported on Windows 98 and later. I venture a guess that nobody in your shop is running anything older than XP but my point is that you don't need to install ANYTHING: no interpreter, no runtime library, etc...
    - VB Script is fairly intuitive if you have ever done VB6 or earlier (not VB .Net which is for all intents and purposes a completely different language than VB "classic")

    3. If you are all using the latest systems like Server 2008 and Windows 7, you can use Powershell 1.0 without additional installation (maybe vista has this already but I'm not 100% sure)

    Alternatively, if you have a mix of Windows, Linux, Solaris, HPUX, AIX, yadda maybe you want to consider using something like Cygwin on the Windows hosts and having common bash shell scripts across all systems. However, I suspect that even if your environment is heterogeneous, you have more Windows machines than UNIX-like systems. So this would be favoring the uncommon case rather than the common case, I guess. Plus, no offense to skilled Windows users, considering the market share and demographics I would assume that the UNIX users would be more well-equipped to run custom scripts for their platforms, while the majority of Windows users would be hindered by a less-than-streamlined experience.

  150. My RSS reader must be broken by MobyDisk · · Score: 1

    When I saw this article, I thought my RSS reader was broken and it was returning feeds from really old articles. I figured I'd click on it and see some clever use of Windows batch files... but no. I read the summary and thought "LOL: it really is returning old articles!" Then I saw the comments... and the date... holy moly.

    I wrote a batch file last week. It copied some files from point A to point B. When it had to conditionally copy one, I wrote a C# app because I didn't have time to learn powershell. But writing a batch file to deal with a printer? Does that work with LAN printers? Did you have to map an LPT port? Dear Lord! Get your skills up to date before you find yourself sitting on your front porch with a shotgun, trying to get kids off your lawn!

    (Mods - yes, this post was meant to be funny)

  151. Powershell 2.0 FTW! by Anonymous Coward · · Score: 0

    Powershell 2.0 FTW!

  152. Re:Better Alternatives to DOS Batch Files? by Anonymous Coward · · Score: 0

    Funny I got called troll... obvious, ok, but troll? The guy posts a questin about DOS in, let me see, 2010... and I'm the troll?

    Heh, whatever.

    To the guy who suggested that I put my head in a vise... (and the genius that said "LOL"), I answer: you are part of the reason I fell honored to get "-1" here.

    This was once a place for great guys. Seeing you I sincerely feel it's great to get -1... I even hope for another negative rating, maybe a -2 if that exists.

    Besides, just between us, I'm a foreigner and don't really know what a vise is... I probably will search on google after this... is it some kind of vase?

    I hope some /. founder read this and ponder whether this is what they planned the site to be...

  153. IronRuby + Project White by Anonymous Coward · · Score: 0

    I'm surprised that IronRuby - a .net based Ruby implementation - hasn't been discussed in this context. The recent 1.0 release provides excellent integration with .net, and there is a host of good unit test frameworks for Ruby that works well with the IronRuby. For Windows GUI tests, Project White provides a very user friendly layer on top of Microsofts UIAutomation framework. For web integration testing you can use Watir or Webrat.

    The language is fairly easy to learn and IMHO much easier to work with than VB.

    For the Python buffs out there, there is IronPython which has the same capabilities regarding .net integration.

  154. Windows Scripting Host by greggman · · Score: 1

    I don't know how old your machines are but I believe every version since at least Windows 2000, maybe even 95, has had Windows Scripting Host so no need to have your users install anything.

    You can use visual basic scripting or javascript (jscript)

    http://en.wikipedia.org/wiki/Windows_Script_Host

    There are books on it.

    If your stuff works as DOS commands great. If you find you need more power to your language and you don't want users to have to install anything than Windows Scripting Host is probably your only other option.

  155. Perl2Exe is just a wrapper? by Futurepower(R) · · Score: 1

    My understanding is that Perl2Exe is just a wrapper for the interpreted code. If there is an error, the error message will contain all of your code.

    1. Re:Perl2Exe is just a wrapper? by Will.Woodhull · · Score: 1

      I've never thought of it as "just a wrapper" before. That's interesting.

      In practical terms, perl2exe and its ilk allow perl scripts to be easily distributed on WinXX machines without having to make the Perl language itself available on those machines. And it does so in a way that prevents causal users from altering or seeing the source code.

      The script is "compiled" in the sense that its tokens are replaced by direct calls to the precompiled Perl library functions that are also bundled in the .exe file. It is not "compiled" in the same way that for instance C programs are compiled.

      I don't recall any mode that returned the script itself in any error message, but there may now be one. That wouldn't be of any use to the average user, since he would have to know enough to find and install the Perl language before he could run the script from its plaintext form.

      --
      Will
  156. The only shell you need... by CondeZer0 · · Score: 1

    Is the rc shell by Tom Duff, incredibly simple, elegant and powerful. And you don't need anymore to use obscure operating systems to enjoy its bliss.

    I have used it to build a whole content management system, and has turned out to be as close to perfect as any piece of software could be.

    --
    "When in doubt, use brute force." Ken Thompson
  157. Consider python by Anonymous Coward · · Score: 0

    Benefits of python:-

    1. You can write the core of the application to be accessible as a command line utility.
    2. You can optionally add/extend a GUI based on QT, TK or the Wx toolkit.
    3. You can compile it if required to remove the dependencies on the target deployment platform.
    4. You can integrate unit tests using the unittest module.
    5. You can easily output HTML using a variety of ready made frameworks or templating languages.
    6. There is loads of code out there to learn from.
    7. Arguably easier to read & maintain than DOS batch files.
    8. Not dependent on any single vendor.
    9. Free.

    Just my 2c.

  158. Re:If It Works, It Works But Remember Your Custome by serialband · · Score: 1

    Add a wizard for common scenarios... anything but documentation that no one will read.

    I prefer documentation over some stupid, poorly designed wizard that doesn't allow me to do the complex things I need. Stop designing everything for the lowest common denominator. Youtube already exists. Someone will always be too stupid, or find a way to be stupid and there's nothing you can do to fix that.

  159. batch to python transition by sergiol · · Score: 1

    In my company, I had to do also an automated test suite.
    I began with batch files, because there were already some very basic scripts done by another developer and I as extending them.

    But, the suite needed some more advanced things, like time profiling. Batch files were too bad to do time calculations, even the simplest.

    So, I decided to migrate to a scripting language, and I was between Tcl (I already did things with it, even controlling Networking printers through SNMP and PCL) and Python (Never touched it).

    Even I like more the Tcl syntax, I decided for Python, because:
      - Python has a more active community and is not dying, unlike Tcl
      - I could learn Python
      - I could get help from some colleagues at my job
      - If the thing needs to be maintained, it will is more likely to get people that knows Python than Tcl
      - It has some modern developments that Tcl does not have

    But, I also had some problems. First Python is now in a phase of deep restructuring, and I was doing it in Python 3 and had lots of problems, mainly because of some extras for Python that are not compatible. After, I discovered a chat Channel whose topic says "It's to early to use Python 3".
    So I downgraded it and got the job done. So, if you go for Python, I recommend seriously 2.6

    And you can also have some Windows things, may be it is why you are reticent of moving out from batches. I used winreg module to access the Windows registry.