FileChangeDir

首页  后退  前进

FileChangeDir
down2

FileChangeDir

更改当前工作目录.

 

FileChangeDir ( "path" )

参数

path

当前工作目录的路径.

返回值

成功:

返回 1.

失败:

返回 0, 工作目录未改变.

备注

成功的返回会改变 @WorkingDir 的值.

函数示例

#include <MsgBoxConstants.au3>
Example()
Func Example()
    ; Display the current working directory.
    MsgBox($MB_SYSTEMMODAL, "", "The current working directory: " & @CRLF & @WorkingDir)
    ; Set the working directory @WorkingDir to the @WindowsDir directory. This is normally C:\Windows.
    FileChangeDir(@WindowsDir)
    ; Display the working directory after setting it to the windows directory.
    MsgBox($MB_SYSTEMMODAL, "", "The current working directory: " & @CRLF & @WorkingDir)
EndFunc   ;==>Example

----------------------------------------

 

该函数可以通过命令 exect 调用

参见:

@WorkingDir

例子
copy

exect=FileChangeDir(@ScriptDir)_ViewValues(@WorkingDir) ;; 将当前目录设置为脚本文件夹

up2

tcimage © Аверин Андрей для Total Commander Image Averin-And@yandex.ru