wpf - Running cmd command from vb.net issue -


i trying run following code in click event. because executes command in cmd shell, don't know why wont run. can open cmd.exe administrator commenting out arguments. stick these arguments in .bat file, running process.start.

however, why cant run shell arguments? i'd prefer method on putting arguments in .bat file.

    dim process new system.diagnostics.process()         dim startinfo new system.diagnostics.processstartinfo()         ' startinfo.windowstyle = system.diagnostics.processwindowstyle.hidden          startinfo.filename = "cmd.exe"         if system.environment.osversion.version.major >= 6 ' windows vista or higher             startinfo.verb = "runas"         else             ' no need prompt run admin         end if         startinfo.arguments = "/c bcdedit /set {current} safeboot network"         process.startinfo = startinfo         process.start() 

figured out. had copy bcdedit.exe project. had thought calling cmd.exe go location bcdedit.exe located.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -