so this is the method of how you can start localhost any server with any port using bat file shortcut having cmd commands
1) first of all create a text file and change its extention to .bat
2) well, i have three scenario's means i have three different apps that's run on different ports and have
different commands to run their servers so i will go through to all different scenarios
3) open .bat file in txt editor as i did so i am going to run a php laravel app which runs on port 8000
well, i hava my laraval project in directory "C:/lv/newone" so first i need to enter in the directory using cmd command "cd c:\lv\newone"then i need command to open browser and spacific port for which i have command like (start "" "c:\program files (x86)\google\chrome\application\chrome.exe" --new-window "http://localhost:8000/" ) without brackets which start chrome's new window tab with address localhost:8000
4) then simply write command to run app like for nodejs i have "php artisan serve" place cmd /k before last command that will keep cmd window open
Example's:
angular js app
nodejs app
even you can also start any of your desired program like i also used to start my IDE that had my project lastly opened like
so this is the solution you can start any localhost server and command using .bat shortcut instead of opening cmd then opening directory then browser and port .
<iframe width="560" height="315" src="https://www.youtube.com/embed/7_YSsw1kwUY" frameborder="0" allowfullscreen></iframe>
visit my youtube channel ☺☻and other blogs for more such trciks
No comments:
Post a Comment