954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

OS drive name and exe file execution

1.I want my program to get the drive letter (like c:\,d:\) on form load and save that to a variable.What should i do to get the drive letter?

2.I want my application to fire this command (shutdown -s -p) on button click. But if i use this path (process.start("F:\Windows\System32\shutdown.exe -s -p")) to do the work it doesn't work.
The path is correct.What to do.

please help and enlighten me.

honey61399
Newbie Poster
7 posts since Mar 2011
Reputation Points: 10
Solved Threads: 0
 

Hi,

For your second question, use this in a button event:

System.diagnostics.Process.Start("shutdown", "-s") 
' Will cause the computer to shutdown
Luc001
Posting Whiz
376 posts since Mar 2010
Reputation Points: 85
Solved Threads: 98
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: