5 votes
Accepted

Batch file to delete calling program and then itself

TASKKILL /IM "%filename%" /F It makes sense that you might want to do this, but I expect the file would be more useful if it waited for its calling program to end ...
Josiah's user avatar
  • 5,996
5 votes

Batch file to backup and update SQL Server DBs

Well, in case anyone is interested, here is what I've come up with: BASICS I like using the :: type of comments over REM ...
carlossierra's user avatar
5 votes

Batch script to make folders hidden

I am glad you asked your question here. I'm hoping to explain why what you are trying to do is a bad idea. I cannot speak much for improving your batch as that is not my strong point but that should ...
Matt's user avatar
  • 2,568
4 votes
Accepted

Conways Game of Life in cmd batch file

Ok so it turns out that the using CALL in a batch script is very slow. So calling a function once per cell was very expensive time-wise. So I knew I had to move ...
chazjn's user avatar
  • 633
4 votes
Accepted

Login System In Batch

My main recommendation is that your variables have more descriptive names. While !x! may seem like a reasonable variable name for a counter that you're never going ...
SomethingDark's user avatar
4 votes
Accepted

Batch file to backup and update SQL Server DBs

Function style Indent the function's commands so the reader can recognize easily which command belong to the function. Add localization of environment variables. This can be done by issuing a ...
napuzba's user avatar
  • 396
3 votes
Accepted

Download NASA images to use as Windows wallpaper

First : I recommend you to change this line in your code in order to anybody can use it easily without changing or editing it. ...
Hackoo's user avatar
  • 206
3 votes
Accepted

DOS batch script to open file explorer

It's not terrible as it is, but you're right to wonder if there's a better way. As you noticed already, it would be nice to keep the associations between the abbreviation and the corresponding ...
Edward's user avatar
  • 66.4k
3 votes

Conways Game of Life in cmd batch file

A few years late to the party, but there are some more things that can be done to improve efficiency. Utilise an "infinite" For /L loop as opposed to the slower Goto :label loop. Note : ...
T3RR0R's user avatar
  • 141
2 votes

Media manager batch script for qbittorrent downloads + video sorting & duplicates check

To answer your question, your code should be descriptive enough that it would read like English and make sense if someone reads it from top to bottom. You should only ever need to add descriptions if ...
Chay Harley's user avatar
2 votes

Copying a file hash to clipboard without PowerShell

All zero-sized files will have the same checksum using the same given hash algorithm. Hence, use the following batch-script: ...
JosefZ's user avatar
  • 494
2 votes
Accepted

Batch code that boots up minecraft servers

I completely omitted the :HELP section by adding description to labels :label - Description here and ...
ScriptKidd's user avatar
2 votes
Accepted

How could I have made this Powershell script that executes robocopy code better

If you don't want an external csv file, use an internal one - simulated with a here string and ConvertFrom-Csv in a date format specifier upper case ...
LotPings's user avatar
  • 328
2 votes
Accepted

Simple fool-proof Minecraft installer

Review context: Both Author and Reviewer are not expert at batch. My intent is that some new engineer, also not expert at batch, should be able to come along in a few months and maintain this. ...
J_H's user avatar
  • 25k
1 vote

Spring Batch Item Writer Calling Stored Procedure

Is there any approach to enhance the performance for processing 17,000 records, which currently takes approximately 21 minutes? So app level throughput is less than 14 row/second. Yikes! Achieving ...
J_H's user avatar
  • 25k
1 vote

Random-number-guessing game as a batch script

The core logic of Number generation and comparison can be greatly simplified by using For /L and For /F loops in conjunction ...
T3RR0R's user avatar
  • 141
1 vote

Sorting files into subdirectories based on keyword scores

Maybe the following wrapper script could help: ...
JosefZ's user avatar
  • 494
1 vote

Batch file to delete calling program and then itself

I've applied Josiah's suggestions. I added a kill switch rather than removing the TASKKILL because there are cases where an application runs a batch file and waits ...
Kyle Delaney's user avatar
1 vote
Accepted

Windows directory tagger in C++

...
Incomputable's user avatar
  • 9,484
1 vote
Accepted

Compute Gregorian year from given number of days since day zero

Finally I found a much better algorithm for deriving the year from the given number of days. It is non-iterative and basically operates in three phases: The number of days is divided by 365.2425 ...
aschipfl's user avatar
  • 173

Only top scored, non community-wiki answers of a minimum length are eligible