Cmd prompt here in vb.net treeview

I create my own tree finder that only has my code repository, my projects folder for visual studios and other things like that for quick access and maybe eventually on the fly versions. I would like to be able to right click on a folder in this explorer and get the cmd.exe message here, for example in Windows Explorer with powertoy. Any ideas? cmd.exe / k opens a prompt and leaves it open, but I can't find any flags or text in it to start from a specific drive or folder.

0


a source to share


3 answers


You just need to set the working directory:



Dim psi As New ProcessStartInfo("c:\Windows\System32\cmd.exe", "/k")
psi.WorkingDirectory = "<path of the selected directory>"
Process.Start(psi)

      

+2


a source


There seems to be another way to do this, but you can pass commands to be executed as command line parameters to cmd:



cmd /k "cd c:\myDirectory"

      

+2


a source


Try setting the tag property for treenode to contain the entire folder path.

Then you can easily create your code that opens a command prompt window to enter the correct file location. It will also allow you to easily add / edit nodes on the fly.

0


a source







All Articles