• Post Reply Bookmark Topic Watch Topic
  • New Topic

Opening Command Line and Running File  RSS feed

 
Marisa Proscia
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I want to use a button in my JFrame to open the command line and run a file. I can't figure out how to get the code to be right.

This is what I have so far:



I don't know where to include the file string. Right now this opens a command window but doesn't do anything.

Any help is super appreciated!!

 
Norm Radder
Rancher
Posts: 2240
28
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
doesn't do anything. 

What do you want the code to do?
What command would you manually enter on the command line to do it?
 
Marisa Proscia
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was actually able to get the command line to open and run PowerShell the way I wanted it to. Was actually missing a line in the script. Thanks though!
 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch
What was the missing line? Why are you writing such platform‑dependent programs?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!