use strict; use warnings; use Tk; my $top = MainWindow->new; $top->geometry('100x100'); my $file = 'C:/Autoexec.bat'; $top->Button( -text => 'Click Me', -command => sub{ system "start C:/Windows/Notepad.exe $file" } )->pack; MainLoop;