Modify the date with batch processing and then change it back


XP system, because to run a cracking software, the date must be 2011-02-01, in order to run the software, requirements, run this batch first record today is XX X month X day, then change the date to 2011.2.1, and then run artcampro.exe file, batch processing in the background silently run, 30 seconds to judge artcampro.e. Whether the Xe process exists or not, if it does not exist, change back to the original date
In fact, I also have some ideas, that is, I feel troubled. I hope that the batch processing experts can help me. After solving the problem, we must add a reward to copy and paste the Party, which will not be used.

Copy codeThe code is as follows:
@echo off
SET y=%date:~0,4%
SET m=%date:~5,2%
SET d=%date:~8,2%
ECHO %y%/%m%/%d%
DATE 2011/02/01
START “” d:\artcampro.exe
ping -n 31 127.1>nul
tasklist |FIND “artcampro.exe”>nul
IF %errorlevel%==1 (DATE %y%/%m%/%d%&&EXIT) else (GOTO loop)

A 30-second loop detects whether the process exists and exits the batch if it does not exist.

Question: If I run this software several times, will there be several such processes at the same time?
Answer: It depends on whether the program runs continuously several times, that is to say, the previous program (artcampro.exe) has not been closed. I just wrote this to judge whether there are, not to judge how many. As “according to Mengqin Yao” said, start/wait wait for the program to end. This can be used to start a program.
Question: I don’t know about start/wait. If you close the artcampro.exe program, you can change the time back. That’s the best.
So how should I write it?

Copy codeThe code is as follows:
@echo off
SET y=%date:~0,4%
SET m=%date:~5,2%
SET d=%date:~8,2%
ECHO %y%/%m%/%d%
DATE 2011/02/01
START /WAIT “” d:\artcampro.exe
DATE %y%/%m%/%d%&&EXIT

Complete code.

Question: I didn’t know START/WAIT before. Today I have long knowledge. Thank you, and thank you all for your answers.
Questioner Comments: Thank you again

Three other answers

Copy codeThe code is as follows:
@echo off
(echo %date:~0,-3%)>1.txt
date 2011.2.1
start artcampro.exe
tasklist|find /i “artcampro.exe” || goto begin
ping -n 30>nul
goto loop
set /p d=<1.txt
date %d%

Order details:
Start / wait, you can see the command help
WAIT starts the application and waits for it to terminate.


If it is an internal CMD command or batch file, the command processor uses
The cmd.exe/K switch is running. This means that after running the command, the window
It will still exist.

If it is not an internal CMD command or batch file, then it is a program and will
Run as a window application or console application.

Yyykkkyyyy | 13
Help you lazy batch processing put the artcampro.exe program in the same location and send shortcuts to the desktop. If the program has been enabled and is running before, it will not start again and change the date.

Copy codeThe code is as follows:
@echo off&cd/d “%~dp0”
if “%~1″==”h” goto begin
if not exist hide.vbs (
echo Set ws = CreateObject(“Wscript.Shell”^)
echo “cmd /c %~s0 h” ,vbhide)>hide.vbs
start hide.vbs
tasklist|find/i “artcampro.exe”&&exit
set td=%date:~,10%
date 2011-02-01
start “” /wait “artcampro.exe”
date %td%

Yimeng Qinyao | Know from Mobile Phone | 13
In fact, it does not need to detect, just use the start / wait command to let the batch waiting program end, so you can combine the content of jd08139 as a friend.

Recommended Today

Implementation of PHP Facades

Example <?php class RealRoute{ public function get(){ Echo’Get me’; } } class Facade{ public static $resolvedInstance; public static $app; public static function __callStatic($method,$args){ $instance = static::getFacadeRoot(); if(!$instance){ throw new RuntimeException(‘A facade root has not been set.’); } return $instance->$method(…$args); } // Get the Facade root object public static function getFacadeRoot() { return static::resolveFacadeInstance(static::getFacadeAccessor()); } protected […]