How do I increment a value using the regular Windows command-line?

Asked By 0 points N/A Posted on -
qa-featured

Hello friends.

I need to be able to increase a date in my text program so that I can keep track of the number of days worked during a project. I need to find out how to increment a value using the Windows command-line.

I know there is a way to do this by using a small script that tells the program to increase the value but I am not sure how to do this. I am hoping someone can give me some suggestions on simple ways to go about doing this.

Thank you so much.

SHARE
Best Answer by Gutierrez Zeno
Best Answer
Best Answer
Answered By 0 points N/A #176458

How do I increment a value using the regular Windows command-line?

qa-featured

Hello,

First of all, you need to familiarize yourself with powershell to be able to know how to do the increment of value or alternatively You can go to this website to acquaint yourself more on how to go about it step by step.

Regards,

Zeno

Answered By 0 points N/A #176460

How do I increment a value using the regular Windows command-line?

qa-featured

I suggest you try using a batch file (.bat).

Check each line of the file by using "findstr" to locate the line you want, then use "FOR /f" to process it, along with a set of "tokens" and "delims". When the number of workdays done is found, put it into a variable, increase it by 1, then replace the previous line with the incremented value by using the "append" operator.

Ideally, this batch file you would then put into your "Startup" folder and every time you restart your computer, it would run. This also hinges on the assumption that you will restart your computer exactly once a day, though.

Related Questions