找回密码
 加入
搜索
查看: 3765|回复: 8

如何用Au3格式化硬盘?

[复制链接]
发表于 2009-3-11 15:32:26 | 显示全部楼层 |阅读模式
想要用Au3来格式化一下 D:盘,找了下好像只看到一个说调用
windows自带的工具来实现,但又不太理解这个 api 的调用
想问下各位有没别的不同方案或帮忙解释下这个调用的各个参数代表什么?
Local $DriveNumber=3   ;A盘为0,B盘为1,C盘为2,D盘为3,依次类推……
Local $FormatOptions=1 ;1为快速格式化,0为完全格式化
DllCall("shell32.dll","int","SHFormatDrive","hwnd",0,"int",$DriveNumber,"int",0,"int",$FormatOptions)

如果我只想格式化D盘要怎么样写才比较好呢

[ 本帖最后由 zjg2003 于 2009-3-20 14:48 编辑 ]
发表于 2009-3-11 16:54:47 | 显示全部楼层
哎,不想拿自己做试验!
发表于 2009-3-12 10:12:03 | 显示全部楼层
不是已经写的很明白了么?
你贴出来的就是格式化D盘
格式化E盘就是
Local $DriveNumber = 4 ;A盘为0,B盘为1,C盘为2,D盘为3,依次类推……
Local $FormatOptions = 1 ;1为快速格式化,0为完全格式化
DllCall("shell32.dll", "int", "SHFormatDrive", "hwnd", 0, "int", $DriveNumber, "int", 0, "int", $FormatOptions)
发表于 2009-3-12 10:36:30 | 显示全部楼层
  自己都有注释的了` 声明 变量 是多少,那么底下就是多少呀`汗``还要问啊?
发表于 2009-3-12 14:50:16 | 显示全部楼层
用RUN实现就完了 弄得那么费尽干什么?
 楼主| 发表于 2009-3-12 20:03:12 | 显示全部楼层
原帖由 renren 于 2009-3-12 10:36 发表
  自己都有注释的了` 声明 变量 是多少,那么底下就是多少呀`汗``还要问啊?


晕,我是说这句:
DllCall("shell32.dll","int","SHFormatDrive","hwnd",0,"int",$DriveNumber,"int",0,"int",$FormatOptions)
后面的东东各代表什么意思?总是不太明白啊,给说明白下啊。

Run (…… format d:/q/u) 的这么一句大概也能行吧,记不太清楚了。
不过我网吧的系统禁用格式化了,这句好像没作用!
发表于 2011-11-24 23:17:35 | 显示全部楼层
系统运行 在这里,格式化
发表于 2011-11-27 21:48:32 | 显示全部楼层
好啊好啊好啊好啊好啊好啊好啊好啊好啊好啊
发表于 2011-11-29 02:01:01 | 显示全部楼层
Parameters
hwnd [in]
Type: HWND

The handle of the parent window of the dialog. The Format dialog must have a parent window; therefore, this parameter cannot be NULL.

drive
Type: UINT

The drive to format. The value of this parameter represents a letter drive starting at 0 for the A: drive. For example, a value of 2 stands for the C: drive.

fmtID
Type: UINT

The ID of the physical format. Only the following flag is currently defined.

SHFMT_ID_DEFAULT (0xFFFF)

The default format ID.

options
Type: UINT

This value must be 0 or one of the following values that alter the default format options in the dialog. This value is regarded as a bitfield and should be treated accordingly.

SHFMT_OPT_FULL (0x0001)

0x001. If this flag is set, then the Quick Format option is selected.

Note  Although this function is included in Shlobj.h only in Windows 2000 SP3 and Windows XP SP1, prior to that it was accessible through Shell32.lib. This flag is ignored under Microsoft Windows NT 4.0.

SHFMT_OPT_SYSONLY (0x0002)

0x002. Selects the Create an MS-DOS startup disk option, creating a system boot disk.

详情参看: MSDN -> SHFormatDrive function
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-1 07:35 , Processed in 0.075451 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表