China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-26 16:56
中国DOS联盟论坛 » 其它操作系统综合讨论区 » [Original] About a small problem with autorun.inf (not sure if it's allowed to ask) View 4,964 Replies 26
Original Poster Posted 2006-12-06 07:03 ·  中国 北京 丰台区 联通
初级用户
Credits 26
Posts 11
Joined 2006-12-06 06:25
19-year member
UID 72712
Gender Male
Status Offline
I got a whim today to try the autorun function. I only wrote two very simple sentences, but it didn't work at all. I hope you all can point out the problem. Thanks first!

The content of my autorun is:
[autorun]
open=e:\1.bat

The content of 1.bat is:
@echo off
pause

I put autorun and 1.bat all in e:\, but it doesn't work at all when double-clicked. Where is the problem?
Floor 2 Posted 2006-12-06 07:08 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
Credits 2,725
Posts 1,160
Joined 2006-09-23 12:00
19-year member
UID 63486
From 河北廊坊
Status Offline
You need to see if your hard drive allows autorun. In fact, most hard drive root directories don't need the AutoRun.inf file to run programs. You can disable the hard drive's AutoRun function. In this way, even if there is an AutoRun.inf file in the hard drive root directory, Windows won't run the program specified in it, thus achieving the purpose of preventing hackers from using the AutoRun.inf file to intrude.

For details, please see here http://www.linuxmine.com/18977.html

[ Last edited by ccwan on 2006-12-6 at 07:15 AM ]
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
Floor 3 Posted 2006-12-06 07:17 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
I thought it was something original, but it turns out the original is a question

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 4 Posted 2006-12-06 07:20 ·  中国 北京 丰台区 联通
初级用户
Credits 26
Posts 11
Joined 2006-12-06 06:25
19-year member
UID 72712
Gender Male
Status Offline
huhu~ I'm sorry for those who were cheated~
I've basically tried all the methods online, and I've also changed the registry key value (now it's 247, which is f7), but it still doesn't work, scratching my head!
Floor 5 Posted 2006-12-06 11:44 ·  中国 广东 深圳 深圳坂田数据中心BGP多线
中级用户
★★
Credits 384
Posts 189
Joined 2005-10-19 13:12
20-year member
UID 43709
Gender Male
Status Offline
It seems that autorun.inf can't run bat files. But it can run if converted to an exe.
Floor 6 Posted 2006-12-06 21:08 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
Credits 2,725
Posts 1,160
Joined 2006-09-23 12:00
19-year member
UID 63486
From 河北廊坊
Status Offline
The upstairs is wrong.

autorun.inf can not only run bat, and vbs is also okay. I have all done these tests.

re CharismA:

To achieve the automatic operation of the hard disk, please see the following article about closing the automatic operation of the hard disk, and the opposite can be realized. (Considering that no one reads the given link, it is directly pasted here)
Closing the automatic operation of the hard disk



Enter Regedit in "Run" in the "Start" menu, open the registry editor, expand to the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Exploer key, and find "NoDriveTypeAutoRun" in the right pane. It is this key that determines whether to execute the AutoRun function of CDROM or hard disk.



Double-click "NoDriveTypeAutoRun". In the default state (that is, you have not prohibited the AutoRun function), in the pop-up window, you can see that the default key value of "NoDriveTypeAutoRun" is 95, 00, 00, 00. The first value "95" is a hexadecimal value, which is the sum of all devices prohibited from automatic operation. Converting "95" to binary is 1001 01 01, where each bit represents a device. The following values are used to represent different devices in Windows:




  In the above list, the value "0" means the device runs, and the value "1" means the device does not run (by default, Windows prohibits 80h, 10h, 4h, 01h and other devices from automatic operation. These values add up to exactly 95h in hexadecimal, so the default key value of "NoDriveTypeAutoRun" is 95, 00, 00, 00).

  It is not difficult to see from the above analysis that under the default circumstances, the devices that will automatically run are DRIVE_NO_ROOT_DIR, DRIVE_FIXED, DRIVE_CDROM, DRIVE_RAMDISK these 4 reserved devices. So to prohibit the hard disk from automatically running the AutoRun.inf file, you must set the value of DRIVE_FIXED to 1. This is because DRIVE_FIXED represents a fixed drive, that is, the hard disk. In this way, the original 100101 01 (looking from the bottom up in the "Value" column in the table) becomes binary 10011101, which is converted to hexadecimal as 9D. Now, change the key value of "No Drive Type AutoRun" to 9D, 00, 00, 00, close the registry editor, and restart the computer to close the AutoRun function of the hard disk.



How to prohibit the AutoRun function of the optical disc? In fact, it is to set DRIVE_CDROM to 1, so that the first value in the "No Drive TypeAutoRun" key value becomes 10110101, which is 16 hexadecimal B5. After changing the first value to B5, close the registry editor, and restart the computer to close the Autorun function of CDROM.



If you only want to prohibit the AutoRun function of the software optical disc but retain the automatic playback ability of the CD audio disc, at this time, you only need to change the key value of "No Drive Type AutoRun" to: BD, 00, 00, 00.



If you want to restore the AutoRun function of the hard disk or optical drive, you can perform the reverse operation.

In fact, most hard disk root directories do not need the AutoRun.inf file to run programs. Therefore, we can completely close the AutoRun function of the hard disk. In this way, even if there is an AutoRun.inf file in the hard disk root directory, Windows will not run the program specified in it, so as to achieve the purpose of preventing hackers from using the AutoRun.inf file to invade.
Device name
Value
Meaning of device name

DKIVE_UNKNOWN
0101h
Unidentifiable device type

DRIVE_NO_ROOT_DIR
1002h
Drive without root directory (Drive without root directory)

DRIVE_REMOVABLE
2104h
Removable drive (Removable drive)

DRIVE_FIXED
3008h
Fixed drive (Fixed drive)

DRIVE_REMOTE
4110h
Network drive (Network drive)

DRIVE_CDROM
5020h
CD-ROM (CD-ROM)

DRIVE_RAMDISK
6040h
RAM disk (RAM Disk)
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
Floor 7 Posted 2006-12-06 22:41 ·  中国 北京 丰台区 联通
初级用户
Credits 26
Posts 11
Joined 2006-12-06 06:25
19-year member
UID 72712
Gender Male
Status Offline
Thanks ccwan, I tried the method above. Now the value of that key is 0x00000095, but it still doesn't work! I also changed the "NoDriveAutoRun" key value to 0x00000095 at the same time. I wonder if it's a problem here?
Floor 8 Posted 2006-12-06 22:50 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
Credits 2,725
Posts 1,160
Joined 2006-09-23 12:00
19-year member
UID 63486
From 河北廊坊
Status Offline
You need to restart the machine after changing the key value
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
Floor 9 Posted 2006-12-06 22:56 ·  中国 北京 丰台区 联通
初级用户
Credits 26
Posts 11
Joined 2006-12-06 06:25
19-year member
UID 72712
Gender Male
Status Offline
Um~ I restarted~ Is it because my autorun writing is incorrect?
Floor 10 Posted 2006-12-06 23:24 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
To make AutoRun take effect, it's very simple. Just change the drive letter and then change it back.

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 11 Posted 2006-12-06 23:38 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
Credits 2,725
Posts 1,160
Joined 2006-09-23 12:00
19-year member
UID 63486
From 河北廊坊
Status Offline
Here's the translation:
Give you an example, download the attachment, put it under d:, restart and then double-click to open the d drive, tell me what result you can see.

[ Last edited by ccwan on 2006-12-6 at 11:47 PM ]
Attachments
auto.rar (202 bytes, Credits to download 1 pts, Downloads: 119)
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
Floor 12 Posted 2006-12-07 00:09 ·  中国 北京 丰台区 联通
初级用户
Credits 26
Posts 11
Joined 2006-12-06 06:25
19-year member
UID 72712
Gender Male
Status Offline
I see~ Thanks~ It seems that my autorun content was written incorrectly~ May I ask what's wrong with my way of writing?
Floor 13 Posted 2006-12-07 00:22 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
Credits 2,725
Posts 1,160
Joined 2006-09-23 12:00
19-year member
UID 63486
From 河北廊坊
Status Offline
open=*** should be correct, otherwise how is the autorun on the CD implemented? Since I'm not a professional studying these, I don't know much either.
But since it doesn't work, let's try other methods.
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
Floor 14 Posted 2006-12-07 00:28 ·  中国 北京 丰台区 联通
初级用户
Credits 26
Posts 11
Joined 2006-12-06 06:25
19-year member
UID 72712
Gender Male
Status Offline
Floor 15 Posted 2006-12-07 01:23 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline

  Re ccwan :

  Actually, what you said in the URL in the second floor is relatively clearer. The sixth floor's post does not clearly explain which device each bit in the hexadecimal form of the NoDriveAutoRun key value corresponds to. Hehe.
Forum Jump: