[英]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.