Batch Command bat and com Formats
@echo off Start
echo Display content Custom task display
echo. & pause End
Virtual disk subst target directory virtual disk name
if not exist file path scheduled execution command cannot activate a file execution command
start path\file name.exe can use relative path to start software in specified location
call command execute command
echo. blank line
echo Display content display scheduled content
title title name set window title
pause display Press any key to continue……
exit exit command line window
start /wait program name\program installation file name installation parameters
-s automatic installation applicable to Install Shield
f2/"path\installation log name.log" set installation log applicable after -s parameter
/q automatic installation applicable to Windows Install
/qn automatic installation applicable to Windows Install
/qn+ automatic installation applicable to Windows Install display confirmation dialog after ending
REBOOT=Suppress prohibit system restart prompt applicable after /qn parameter
REBOOT=ReallySuppress prohibit system restart applicable after /qn parameter
/SILENT automatic installation display installation progress applicable to Inno Setup
/VERYSILENT automatic installation do not display installation progress applicable to Inno Setup
/NORESTART prohibit system restart applicable after /SILENT parameter
/DIR="x:\dirname" set installation path applicable after /SILENT parameter
/S automatic installation applicable to Nullsoft SuperPiMP Install System
/D set installation path applicable after /S parameter
/s automatic installation applicable to WISE Installer
/d set installation path applicable after /s parameter
/noreboot prohibit system restart applicable after /s parameter
/x decompression path extract software directly to folder
Regedit file name.reg/s; import registry
regsvr file name.dll/s; register COM component
RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSectionDefaultInstall 128.\file name.inf install inf file
Move path new path rename
del path delete
CD path open command
Md path create directory
C:\Windows\regedit.exe /s path/registry file name.reg import registry file without prompt
INI Format
IconFile=path and file name.ico
IconIndex=0
SourceIcon=path and file name
ConfirmFileOp=0
IconArea_Image=folder picture background file name.bmp
IconArea_text=font color 0x00888888
INF Format Device Information File
open=file name.exe open=ShelExec.exe web page name.htm
icon=file name.ico
shell\mark=content displayed when right-clicking mouse
shell\mark\command\=program or command data file
Open=regedit/s registry type file name.reg add /s parameter to not display any information when importing
Signature="$WINNT$"
AddReg=file name_AddReg add registry information
DelReg=file name_DelReg delete registry information
first item abbreviation,"subsequent path","key name",class,"value"
first item abbreviation - HKEY_LOCAL_MACHINE use HKLM instead.
Path - path use \ separator.
Class - REG_SZ use 0, REG_DWORDW use 65537, REG_BINARY use 1.
Value - if relative path is needed in value, use "%01%" instead of its absolute path.
Write like this
shell\New window open(&W)\command=explorer %1
"explorer %1" can be replaced with the program to run
open=This section is only useful for CDs in XP, and my method is needed for local hard drives
Viruses also use the shell command to run
Enter Regedit in "Run" in the "Start" menu, open the Registry Editor, expand to the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer key, find "NoDriveTypeAutoRun" in the right pane, and this key determines whether to execute the AutoRun function of CDROM or hard drive.
Double-click "NoDriveTypeAutoRun", in the default state (that is, you have not prohibited the AutoRun function), 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 prohibited automatically running devices.
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: Device Name Which Bit Value Device Name Meaning DKIVE_UNKNOWN 0101h unrecognizable device type DRIVE_NO_ROOT_DIR 1002h drive without root directory DRIVE_REMOVABLE 2104h removable drive DRIVE_FIXED 3008h fixed drive DRIVE_REMOTE 4110h network drive DRIVE_CDROM 5020h CD-ROM DRIVE_RAMDISK 6040h RAM disk RESERVED 7180h unspecified drive type
In the above list, a value of "0" means the device runs, and a value of "1" means the device does not run (by default, Windows prohibits automatic running of devices with values 80h, 10h, 4h, 01h, and these values add up to 95h in hexadecimal, so the default key value of "NoDriveTypeAutoRun" is 95, 00, 00, 00). It can be seen from the above analysis that in the default case, the devices that will automatically run are DRIVE_NO_ROOT_DIR, DRIVE_FIXED, DRIVE_CDROM, DRIVE_RAMDISK, which are 4 reserved devices. So to prohibit the hard drive from automatically running the AutoRun.inf file, you must set the value of DRIVE_FIXED to 1, because DRIVE_FIXED represents the fixed drive, that is, the hard drive. In this way, the original 100101 01 (viewed 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 turn off the hard drive's AutoRun function. How to prohibit the CDROM AutoRun function? Actually, it is to set DRIVE_CDROM to 1, so that the first value in the "No Drive TypeAutoRun" key value becomes 10110101, which is hexadecimal B5. After changing the first value to B5, close the Registry Editor, and restart the computer to turn off the CDROM's Autorun function. If you only want to prohibit the AutoRun function of the software CD but keep 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 drive or CDROM, you can perform the reverse operation.
In fact, most hard drive root directories do not need the AutoRun.inf file to run programs, so we can completely turn off the hard drive's AutoRun function. In this way, even if there is an AutoRun.inf file in the hard drive root directory, Windows will not run the program specified in it, thereby achieving the purpose of preventing hackers from using the AutoRun.inf file to invade.
|