|
I am currently writing them at my new job. Mainly they are small things that help me with what I am doing instead of having to manually delete logs.
I also wrote them at my old job to do the following:
Delete a folder on the Build Server,
Get Latest Code,
Build the code,
and then deploy it.
|
|
|
|
|
Recently wrote some .bat files to automate a nightly build. I know there may be better tools for such tasks, but I still remember bits of DOS from my youth, and therefore can't be bothered to learn another script language.
Over the decades I've used various script languages, starting from (C=ommodore) Basic, over BS 2000, Amiga-DOS, Unix sh and bsh, MS-DOS, and a few others, but of these I've only used MS-DOS over the past years. Not because it's so good, but simply because that way I don't need to learn yet another script language 
|
|
|
|
|
Yes Dave, but thenI'm another old fart! I use them to ease deployment of new application versions without kicking users out. I drop the new version in the folder, update the BAT file and users pick up the new version on next launch. I also use them to copy new versions to remote sites using a control text file to mark installation (we have lots of sites with slow or unreliable radio links).
Now, in the good old days of DOS, I had complete menuing systems running off of BAT files!
Phil
Life is like a s**t sandwich; the more bread you have, the less s**t you eat.
|
|
|
|
|
I still do, just to make my job easier.
I've always liked them since I developed my own system with my father's TRS-80 Model I. Setup so, the OS booted and started up BASIC to run games or anything else automatically. They didn't have anything like that long ago... you had to type everything by hand.
Now I mainly use it to call my apps to process files and use the batch file to copy the file to the final destination. Multiple projects that interconnect you know. 
|
|
|
|
|
32 and I still do.
Id' rather use Python, but sometimes an script is intended for someone else's use, and there are lots of Windows XP boxes around here, so I have to go with the lowest common denominator.
|
|
|
|
|
My main project is a "self updating" application, but every once in a while we do something that needs a "special" deployment method. I found that a simple BAT file does the trick and prevents the users from royally screwing stuff up...
|
|
|
|
|
At my internship, I was recently tasked with automating backups for a 2003 server.
The goal was to do it preferably for free, of course I hadn't a need to create a batch file in years, but knew I could get it done.
The first batch file uses ntbackup for regular data.
The second one does a backup of SQL data by calling TSQL files (.sql) generated in MS SQL Server Management Studio. This allows the SQL server to not have to be shut down to do backups.
The third one date-stamps and copies the backup files to other locations.
Each batch file is scheduled to run using the built-in Task Scheduler.
Free and fun!
|
|
|
|
|
A developer on my team is nicknamed 'The Batman' for this reason. The rest of us write PS scripts.
|
|
|
|
|
We use bat files for many applications right now. You are not alone. We have gotten away from the complex bat files we used to have, and now mostly we use them to call exe's and handle a bad return code by sending an email from a vbscript. We have a scheduling tool, but it has many bugs so we are thinking of going back to windows scheduler where the scheduled task is a call to a bat file.
|
|
|
|
|
I do! Although I use the .CMD extension now.
|
|
|
|
|
bat/cmd + SendTo shortcuts + GNU utils (sed/grep)
One pet peeve with Win7 is that the SendTo folder no longer supports cascading menus via simple folders/directories.
|
|
|
|
|
Unless you want the script to be read by the 32 (or even 16) bit interpreter, why wouldn't you write .cmd files instead?
Learn bash, and your .cmd skills will improve (and you will start being annoyed at Windows script clumsiness).
|
|
|
|
|
They're useful for calling other programs. For example here if perl is not in the PATH on all PCs - if it is, that's the one to use, but if not, try a known location:
perl c:\Offline\Computer\GMobileSubsets\scripts\perl\fetch.pl HNG %1 %2
if ERRORLEVEL 1 goto tryagain
exit
pause
:tryagain
C:\perl\bin\perl c:\Offline\Computer\GMobileSubsets\scripts\perl\fetch.pl HNG %1 %2
if ERRORLEVEL 1 goto err
exit
pause
:err
pause >nul Perl error! Contact IT. Press any key
(I always have pause after exit, so I can quickly add REM in front of exit when testing
The same applies in a mixed 32/64 bit environment: C:\Program Files (x86)\ or C:\Program Files\
Also, when calling sequences of taskkill, file copy/delete, etc - you can put a shortcut on the desktop to it. Easier than remembering a long list of services to be restarted in a particular order, etc. Useful for colleagues if your not available - "just log in to the server and click on the shortcut"
Also, on Windows 7, some users need local administrator rights to run taskkill, etc, but need their own identity when accessing network files. Create an exe file to run a bat file as admin, but use it only on those batfiles requiring it:
C:\Offline\Computer\GMobileSubsets\sw\runaLocalAdmin.exe C:\Offline\Computer\GMobileSubsets\scripts\bat\stopall_reqadmin.bat
|
|
|
|
|
I'm 36 and use .bat files to backup data in certain folders using robo copy commands on a scheduled task. Why pay for backup programs when you can make a quick script for free.
|
|
|
|
|
Do you still use Edlin? 
|
|
|
|
|
I do it daily!
Good Ole'bats! I hard code all internet pages and have a slick program built in access that creates the bat and ftp to do all of my bidding. Its safer, cleaner, fast and far better than drag and drop or any other method I can find for ftping. The access programs archives and does just about evrything else too.
But... in computer years, I too am an "Old fogie." It's sort of odd when you have been programming vb longer than some of young'ns who are programming today have been alive, and that says nothing of having worked the basic "Basic".
But hey don't let the gray hair fool you, I can still keep up with the best of them!
hmmm... So I hear through the grape vine that you were "the poster of the One Millionth Lounge Post"
|
|
|
|
|
Do not feel alone! we are a bunch of programmers that we use bat files to do daily tasks (stored procedures por instance). And not just in DOS also in UNIX... everything to do the job!
Greatings @GI_Giorgio
|
|
|
|
|
Looks like there are a lot of old fogies here
I don't write as many as I used to, but there are cases where a bat file is quicker/easier to write and anyone can maintain.
It also keeps me from having to rewrite all the dos commands that already exist.
If microsoft ever gets rid of the command line, I'm switching to Linux.
|
|
|
|
|
I do write BAT files - and have never gave up on them ever since my IBM PCJr. - once in a while to:
- automate repetitive shell commands
- setup a path
- perform string or repetitive operations on a bunch of files which depends on a search in the current directory.
To "kill the snake and show the stick" (a popular saying in Brazil which denotes "to show that you have really done it") here's a simple example:
for /D %%i in (*) do dir /s "%%i" >> dirs.txt
Julio Cezar
|
|
|
|
|
I do. They are incredibly good for some tasks. Tasks that would take 4 hours in a quick and dirty VBA app hacked by an apprentice can take mere minutes if you remember the DOS commands, thus saving the day.
Now do you use the vi-editor?
|
|
|
|
|
I still use BAT files as they are straight forward and capable of some useful tricks.
One of my recent applications had a GUI front end but the users wanted a batch interface to start / stop / pause / resume it remotely. Simple with batch files: start = single command line to run the application, others = single command line to post a message to the application's input queue (e.g. ECHO PAUSE >>%TEMP%\applicationname_StatusChange.txt ). Then all I had to do was to create shortcut desktop icons to run the batch files and they think that they have a button controlled interface.
|
|
|
|
|
For several years, I was involved with helping at a programming competition run by one of Europe's foremost national computing organisations (name not disclosed for obvious reasons). We had the brightest and best teams from academia and professional companies competing in it.
We never told the teams that our sophisticated testing, scoring, and marking system that compiled, ran, timed, and collated all of their competition entries was a single monolithic BAT file. Admittedly, it grew over the years as more languages and external dependencies were added to the scope of the competition, but it was still a BAT file.
|
|
|
|
|
Well, here in Cuba the whole process of grading the National Programming Contest for High School students is done using bat files. The last one I made for that earned me the nickname "batman".
|
|
|
|
|
I still write an occasional batch file, although I use the newer .CMD file extension. For more advanced needs, I rely on WinBatch.
|
|
|
|
|
Whateva does the job. My favorite has always been Kornshell. Powershell is cool, but seems to lack the elegance of some of the Unix Shells. .bat files are quick and easy, take very little setup/configuration. However, I emphisize with younger programmers, who want to use something new, or improve make thier skill set more competitive. Just remember that if you dont want to box yourself in (kill any oportunity for promotion), dont make it so complex that someone will never be albe to replace you.
|
|
|
|