sonies 发表于 2008-9-23 17:35:07

如何复制当前用户我的文档目录下的所有文件到其它文件夹

如何复制当前用户我的文档目录下的所有文件到其它文件夹?

在不确定当前帐户我的文档目录所在路径的情况下,如何复制本目录下的全部文件到其它文件夹?

我是新手 根据帮助中的相关变量写了好几个样子 都没成功 望高手帮忙~~期待中....

炎舞风影 发表于 2008-9-23 17:42:44

msgbox(0,"教学","当前用户名为:"& EnvGet("username"))

所所思 发表于 2008-9-23 21:46:39

我的文档:
"::{450D8FBA-AD25-11D0-98A8-0800361B1103}"

liongodmien 发表于 2008-9-26 15:49:34


#NoTrayIcon
#include-once
#include <GUIConstants.au3>

GUICreate("复制我的文档", 485, 100)
GUICtrlCreateGroup("", 5, 1, 475, 96)
GUICtrlCreateLabel("将我的文档复制到", 15, 18, 100, 18)
$Input = GUICtrlCreateInput(@MyDocumentsDir, 15, 35, 415, 16, 0x0008)
GUICtrlSetState($Input, $GUI_DISABLE)
$InputButton = GUICtrlCreateButton("浏览", 435, 33, 35, 20)
$CopyButton = GUICtrlCreateButton("进行复制", 370, 65, 80, 25, 0)
GUICtrlSetState($CopyButton, $GUI_DISABLE)
GUISetState()


While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
               
                Case $GUI_EVENT_CLOSE
                        Exit
                       
                Case $InputButton
                        $var = FileSelectFolder("请选择一个文件夹:", "", 1)
                        If @error = 1 Then
                                GUICtrlSetData($Input, @MyDocumentsDir)
                        ElseIf $var = @MyDocumentsDir Then
                                MsgBox(16, "错误", "复制目标目录与源目录相同!", 2)
                        Else
                                GUICtrlSetData($Input, $var)
                                $OK = 1
                                GUICtrlSetState($CopyButton, $GUI_ENABLE)
                        EndIf
                       
                Case $CopyButton
                        If $OK = 1 Then        DirCopy(@MyDocumentsDir, $var, 1)
                       
                        MsgBox(0, "", "文件夹复制完成!文件已复制到目录:" & $var, 3)
                        Exit

        EndSwitch
       
WEnd
页: [1]
查看完整版本: 如何复制当前用户我的文档目录下的所有文件到其它文件夹