defect122

Windows batch - Start a program or open a textfile

Feb 16th, 2012
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2.  
  3. echo. 2>file.txt
  4. echo. 2>file2.txt
  5. echo. 2>file3.txt
  6. echo. 2>file4.txt
  7.  
  8. start file.txt
  9. echo You > file.txt
  10. ping localhost -n 2 > nul
  11. start file2.txt
  12. echo have just > file2.txt
  13. ping localhost -n 2 > nul
  14. start file3.txt
  15. echo opened > file3.txt
  16. ping localhost -n 2 > nul
  17. start file4.txt
  18. echo four textfiles > file4.txt
  19.  
  20. echo Press to exit batch
  21. pause > nul
  22.  
  23. exit
  24.  
  25.  
  26.  
  27. What it does : It opens four textfiles using the standard windows editor with a delay inbetween. This is done by a ping command sending pakets to the loopback device.
Advertisement
Add Comment
Please, Sign In to add comment