tyler6699 Posted December 11, 2007 Share Posted December 11, 2007 I have this code: exec('start /B "window_name" "start_pc.bat"',$output,$return); This will run the batch file and works fine but, I want to replace "start_pc.bat" with a variable How can I execute this: $filename = ("$user ("$user" . ".bat" ); exec('start /B "window_name" "$filename"',$output,$return); Have tried: exec, system and many other ways to execute the file also tried '$filename' but did not work any help will be appreciated as Ive tried for two days to get this working thanks Quote Link to comment Share on other sites More sharing options...
tyler6699 Posted December 11, 2007 Author Share Posted December 11, 2007 excuse the bad spelling think i meant this $filename = ("$user" . ".bat" ); sorry Quote Link to comment Share on other sites More sharing options...
tyler6699 Posted December 11, 2007 Author Share Posted December 11, 2007 <?php $user = "test"; $f = "start /B \"window\" \"$user.bat\""; echo exec($f); ?> this will execute a batch file named "test.bat" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.