【发布时间】:2014-07-07 08:18:55
【问题描述】:
我的问题是我不知道如何将 CopyFile 与 Kernel32 一起使用。
rundll32.exe kernel32.dll,CopyFileA "C:\Users\User\Desktop\test.txt","C:\Users\User\Desktop\test2.txt", 0
我没有使用任何程序,我只想尽可能从“运行”对话框运行该命令。
【问题讨论】:
我的问题是我不知道如何将 CopyFile 与 Kernel32 一起使用。
rundll32.exe kernel32.dll,CopyFileA "C:\Users\User\Desktop\test.txt","C:\Users\User\Desktop\test2.txt", 0
我没有使用任何程序,我只想尽可能从“运行”对话框运行该命令。
【问题讨论】:
您不能使用rundll32 调用CopyFileA,因为CopyFileA 不兼容。您只能使用rundll32 调用具有此签名的入口点:
void CALLBACK EntryPoint(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine,
int nCmdShow);
rundll32的详细信息,包括以上信息,请参见over on MSDN。
例如,您可以在运行对话框中将命令解释器与copy 命令一起使用:
cmd /c copy file1.txt file2.txt -y
【讨论】: