How do I execute command from button or hyperlink?

  • Thread starter Thread starter rerhart
  • Start date Start date
R

rerhart

I am not a scripting expert and would like to click on a cell, like with
a hyperlink or a button (in that cell is the name of a server), and by
clicking on that button or hyperlink, perform the following command
that I currently have in a batch file:

start /D "c:\winnt\system32\" /b mstsc /v:servername /f

I currently have a list of servers with each cell hyperlinked to a
batch file but would like to eliminate the batch files and somehow
incorporate the functionality of the batch file into Excel. This batch
file simply opens a Terminal Services session with a server.

Thanks!
Rich
 
Rich,

Try this. Untested. If you make a button, make the following macro, and
assign the button to the macro (right-click - assign macro).

Sub StartTerminalServer
Shell "start /D c:\winnt\system32\ /b mstsc /v:servername /f"
End Sub
 
Back
Top