Last active
December 18, 2015 12:10
-
-
Save sphingu/5781284 to your computer and use it in GitHub Desktop.
Open Folder / Start .exe With arguments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Process For Get Backup of Your Database | |
System.Diagnostics.Process myProcess = new System.Diagnostics.Process(); | |
myProcess.StartInfo.FileName = "OSQL.exe"; | |
myProcess.StartInfo.WorkingDirectory = @"C:\"; | |
myProcess.StartInfo.Arguments = "-Usa -PmyPasword -n -Q \"BACKUP DATABASE msdb TO DISK = > 'c:\\msdb.dat_bak'\""; | |
myProcess.Start() | |
//Open Folder | |
public void OpenFolder(string dir) | |
{ | |
string argument = @"/select, " + dir; | |
System.Diagnostics.Process.Start("explorer.exe", argument); | |
} | |
//Another Open Folder | |
string windir = Environment.GetEnvironmentVariable("WINDIR"); | |
System.Diagnostics.Process prc = new System.Diagnostics.Process(); | |
prc.StartInfo.FileName = windir + @"\explorer.exe"; | |
prc.StartInfo.Arguments = dir; | |
prc.Start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment