![](/img/trans.png)
[英]Encountering “the system cannot find the file specified” when running a certain command
[英]The system cannot find the file specified when backup the database
我正在尝试备份我的sql数据库。 我先尝试用这个
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Process.Start("C:\Users\user\Desktop\Thesis\BACKUP feb 15\capstone_real\capstone_real\Resources\mysqldump.exe", " -u root -padmin capstone -r ""C:\Users\user\Desktop\Thesis\backup1.sql""")
End Sub
它可以工作..但是我不想指定这样的目录,所以试试这个
Process.Start(" " & Application.StartupPath & "\Resources\mysqldump.exe, -u root -padmin capstone -r ""C:\Users\user\Desktop\Thesis\backup2.sql""")
无效(系统找不到指定的文件)
注意事项
Application.StartupPath
返回路径,例如C:\\ xyz derectories\\bin\\debug
debug
文件夹包含必需的目录 Application.StartupPath
添加了初始空间而导致的
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.