The batch tag is predominantly used for Windows batch file questions.
4
votes
0answers
55 views
Compute Gregorian year from given number of days since day zero
I am working on a batch file for doing date/time maths. One challenge is to determine the (proleptic) Gregorian year from the given number of days that have elapsed since day zero (that is, 1st of ...
3
votes
0answers
32 views
Settings JAVA_HOME with batch
At my work, I need to use multiple versions of Java, depending on which project I work on. I've made a batch script to take care of this. There are several different actions that you can perform with ...
10
votes
2answers
206 views
Batch file to backup and update SQL Server DBs
This is my first windows batch file. The script basically goes through this basic flow of tasks, in order to update some specific SQL Server DBs to a new DB version:
Backup all SQL server DBs that ...
2
votes
1answer
43 views
Movies wrapper script [closed]
I'm trying to do a nice script to be able to wrap my movies. Can you help me to improve it? I want to structure my code better but I don't know the language enough to do it.
...
2
votes
0answers
32 views
GROM – Generalized Release Order Management
Inspired by the StackOverflow question Auto-increment release version Jenkins I developed the following generalized solution.
Is there anything that can be done better, shorter, more elegant, more ...
5
votes
1answer
41 views
DOS batch script to open file explorer
I wrote a script that you can use to open the file explorer from command line like
e db --> opens my Dropbox folder (e.cmd is ...
8
votes
1answer
98 views
Batch script to make folders hidden
I just wrote a simple script cmd to hide private folders by combining several scripts from the Internet. Can anyone give me suggestions for improvement?
This batch file uses a password hidden by ...
5
votes
1answer
287 views
Batch/PowerShell script that toggles the minimized state of a window
I wrote this script for a user who wants to toggle the minimized state of a window that minimizes to the tray. The user required a .bat script, so I wrote a bat + PowerShell hybrid script in order to ...
3
votes
1answer
50 views
Make pinging faster while looking for a Windows PC
This code pings 1 time every IP while using TTL to identify if it's a Windows PC. If so, it outputs it. It's very slow, so is there any way to make it go faster (1-255 in 12 min)?
...
3
votes
0answers
29 views
Automatically push git submodule's parents recursively
I'm absolutely terrible with .bat files, but sometimes they are just needed. Right now I'm working on a project with quite some submodules, which have quite some ...
6
votes
0answers
81 views
Chatty AI that saves .txt files to remember
This is a basic AI that I created. It has a teach function that creates a .txt file with user inputed info for future use. If you type teachme you have the option to type in something that you have ...
2
votes
1answer
464 views
Copying files into Dropbox folder from command line
I made the following code.
Since it is a Batch, any kind of problems can appear.
Please review it and point any problems when copying files into Dropbox!
Its intent is that you will copy a file into ...
3
votes
0answers
114 views
Guess my number
I have a fully working "Guess my number" game, in which the batch file will generate a random number between 0-whatever you choose. I got the idea from this thread, in which I had a rather hilarious ...
8
votes
2answers
138 views
WiFi adapter settings
Yesterday I have found that I can't use the wireless network at some spots in my house. I used another modem as a WiFi booster and I managed to cover these spots.
The problem is that when I go to ...
1
vote
1answer
111 views
Thy Dungeonman 3 using batch
I just started learning commands for batch files. I figured a project is a good way to learn the language better, so I'm attempting to recreate the text-based RPG, Thy Dungeonman 3.
So far, I've ...
0
votes
1answer
205 views
Ajax Done Callback to prevent requests from interrupting each other
I am trying to make sure my Ajax does not send another request before it receives a reply. To the best of my knowledge the code I will post is supposed to do this but I am still getting a -1 for ...
5
votes
1answer
382 views
Batch file command looper
Just a fun batch file I have made. I wanted an easy way to loop any arbitrary command several times: loopme.bat
...
3
votes
1answer
153 views
Batch file for looking through text files
I was creating a program and I was trying to explain it to some of my coding friends. They commented that it was too tedious typing out all the "if" commands. How do I streamline this code?
Note: ...
7
votes
1answer
522 views
Batch script to start the service in a gap of 10 min
I have created a batch script to start the services in a gap of 10 min. My batch file will start the service on the local system and then will wait for 10 mins and starts the service on another system ...
6
votes
1answer
268 views
Windows Batch Tech Tool
I made this to help new techs be more proficient while they are learning. I know most of it is common knowledge around here. I would also like to point out that I don't really know batch but I am ...
1
vote
2answers
819 views
Batch file to copy specific folders and to delete the folder which is not copied
This is the batch file I have created which copy the specific folders which I want. I use the specific server folder name of which I want to copy. This batch file will also delete the folder which you ...
1
vote
1answer
1k views
Batch file to zip logs date wise
This is the batch file I have created which zips the particular month logs and deletes those logs from the source folder after successful zipping. If it does not find the zip file, then it again ...
3
votes
2answers
1k views
Batch file to copy specific folders
This is the batch file i have created which copy the specific folders which I want. I use the specific server folder name of which I want to copy. Please suggest any improvements.
...
2
votes
1answer
77 views
Improving efficiency and flow by changing subroutine orders
A batch file executes WinSCP.exe's console mode to download files and log the actions. Upon exit, WinSCP returns:
ERRORLEVEL 0 if the files are successfully ...
3
votes
1answer
887 views
Checking for a date and compare 2 different files
From snippets around the web, I was able to put together this .bat file to check for a date and compare 2 different files.
This works below but I want to clean it up so it can be much lighter and ...
4
votes
2answers
81 views
Batch file-download script - is it necessary to re-phrase commands?
I run a script to download a file and unzip it. An import process then runs and leaves the files in their source location. I wrote the fully functioning code below to clean up that directory to be ...
3
votes
2answers
337 views
Msbuild batch - if any build fails than skip the last one
I have this batch that builds some projects using msbuild.
What I want to do is to skip building my-last.proj if any of the above builds fail: my-proj1.proj to my-proj5.proj using environment ...
6
votes
1answer
286 views
Making a .bat batch command-line interface
Recently I am working on batch to make a very simple command line interface.
The code looks like this:
...
8
votes
2answers
233 views
Batch-File FizzBuzz
I've never done a FizzBuzz before, so I decided I would. Please let me know what I could have done better. This is ran via a .bat file in Windows.
...
0
votes
2answers
593 views
Speed up SVN backup
The following batch script runs on a Scheduled Task on Windows 7 with a quad core 2.5GHz and 16GB of DDR3.
It makes the svn server unavailable for about 10 minutes, so it can produce a 500MB file, ...