nz4y45 Posted March 3, 2009 Share Posted March 3, 2009 I'm trying to pass a simple ip address to a batch file. what i would like to do is have a form to type in the ip address, and then have a link to the bat file, that will append the ip address typed in the form field to the end of the command. i.e. - when the link is clicked, the batch executes test.bat 169.69.69.0 my batch file would then use the ip supplied to run wmi scripts. Thanks much! Quote Link to comment https://forums.phpfreaks.com/topic/147788-passing-variable-to-batch-file-or-command-line/ Share on other sites More sharing options...
calmchess Posted March 3, 2009 Share Posted March 3, 2009 I use the php file class to write the batch file that way i can pass any variables in that i want and can use exec to execute the batch file if i want. Quote Link to comment https://forums.phpfreaks.com/topic/147788-passing-variable-to-batch-file-or-command-line/#findComment-775756 Share on other sites More sharing options...
premiso Posted March 3, 2009 Share Posted March 3, 2009 As long as the batch file accepts a parameter (I think you need to code that way) system or any one of the exec functions would work. Quote Link to comment https://forums.phpfreaks.com/topic/147788-passing-variable-to-batch-file-or-command-line/#findComment-775764 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.