找回密码
 加入
搜索
查看: 3475|回复: 3

[AU3基础] 用什么办法可以修改盘符

  [复制链接]
发表于 2008-8-25 15:48:47 | 显示全部楼层 |阅读模式
我想把F盘先改成G:盘
然后再将D盘改成F盘..
Au3怎么写?
发表于 2008-8-25 18:35:34 | 显示全部楼层
调用 DOS命令吧 看一下这个 mountvol
给你个例子:
#NoTrayIcon;隐藏小图标
#Include <process.au3>
#include <File.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $tm,$pf,$label_tell,$gui,$ti=60,$su
If $CmdLine[0] <= 0 Then
        $su=''
Else
        For $k=1 To $CmdLine[0]
                $su=$su&' "'&$CmdLine[$k]&'"'
        Next
EndIf        
If FileExists("M:\") Then _start()
Run(@ComSpec & " /c " & 'iscsicli AddTargetPortal 192.168.0.253 3260', "", @SW_HIDE)        
Run(@ComSpec & " /c " & 'iscsicli LoginTarget iqn.2005-02.com.ricecake.iscsi:00 T * * * * * * * * * * * * * * * 0', "", @SW_HIDE)
$gui = GUICreate("连接服务器", 400, 50,-1,-1,$WS_POPUP)
GUISetBkColor (0x3A6EA5)

$label_tell=GUICtrlCreateLabel('正在连接服务器,请稍候……'&@TAB&'60', 0,0,400, 50,0x01+0x0200,$GUI_WS_EX_PARENTDRAG)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 10,800,0, "Comic Sans MS")
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
_GuiRoundCorners($gui, 0, 0, 16, 16)
GUISetState(@SW_SHOW)
AdlibEnable ( "_time", 1000)
For $w=1 To 600        
        If FileExists("M:\") Then
                GUIDelete($gui)
                _start()
        ElseIf FileExists("H:\") And DriveGetType ( "H:" )='Fixed' Then
                $pf='H'
                ExitLoop
        ElseIf FileExists("G:\") And DriveGetType ( "G:" )='Fixed' Then
                $pf='G'
                ExitLoop        
        ElseIf FileExists("J:\") And DriveGetType ( "J:" )='Fixed' Then
                $pf='J'
                ExitLoop                
        EndIf        
        Sleep(500)
Next        
GUIDelete($gui)
If $pf<>'' Then
        $temp=_TempFile()
        _RunDOS('mountvol /L >'&$temp)
        _FileReadToArray($temp,$tm)
        For $x = 1 to $tm[0]
                $xy=StringSplit(StringStripWS ($tm[$x],8), ":")
                If $xy[0]=2 Then
                        If $xy[1]=$pf Then
                                _RunDOS('mountvol '&$pf&': /d')
                                _RunDOS('mountvol M: '&StringStripWS ($tm[$x-1],8))
                                FileDelete($temp)
                                _start()
                        EndIf        
                EndIf
        Next
EndIf

Func _start()
        Run('游戏菜单.exe')
        Sleep(1500)
        Run('C:\WINDOWS\explorer.exe http://192.168.0.252/book/','C:\WINDOWS\')
        Exit
EndFunc        

#Region ###  GUI圆角
Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3) ; thanks gafrost
        Local $XS_pos, $XS_ret, $XS_ret2
        $XS_pos = WinGetPos($h_win)
        $XS_ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $XS_pos[2], "long", $XS_pos[3], "long", $i_x3, "long", $i_y3)
        If $XS_ret[0]Then
                $XS_ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $XS_ret[0], "int", 1)
        EndIf
EndFunc 
#endregion

Func _time()
        $ti =$ti - 1
        If $ti < 0 Then 
                MsgBox(16,'错误','连接服务器超时,请联系管理员!')
                Exit
        EndIf        
        GUICtrlSetData ( $label_tell, '正在连接服务器,请稍候……'&@TAB&$ti)


[ 本帖最后由 qin147 于 2008-8-25 18:37 编辑 ]

评分

参与人数 1金钱 +5 收起 理由
lcgkogoo + 5

查看全部评分

发表于 2008-8-25 19:14:48 | 显示全部楼层
在论坛里找一下了。里面就有
http://www.autoitx.com/forum.php ... &extra=page%3D1
 楼主| 发表于 2008-8-26 11:29:01 | 显示全部楼层
谢谢了...
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-18 08:44 , Processed in 0.081254 second(s), 27 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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