Changing Batch file command result
Posted: 07 Aug 2010 12:15
Im trying to create pretty much a button that i can click to open or save 2 files at once. I want the If statement to go something along the lines of:
If file.txt is open then
save file.txt
else
open file.txt
End
If file.jpg is open then
save file.txt
else
open file.txt
I know basics of If statements but I have almost no experience with Batch files. I would really appreciate it If someone pointed me in the right direction of accomplishing my goal. I do not know exactly what kind of commands are available in this language of programing but I tried something with my basic knowledge. Here is what I got(it must look terrible to you experts)
@echo off
If[not] Ranger_Code.txt=open
START /MAX C:\Users\Jack\Desktop\Game\Wc3\Ranger_Code.txt
If[not] Tbr_Ranger.jpg=open
START /MAX C:\Users\Jack\Desktop\Game\Wc3\Tbr_Ranger.jpg
If Ranger_Code.text=open
SAve /MAX C:\Users\Jack\Desktop\Game\Wc3\Ranger_Code.txt
If Tbr_Ranger.jpg=open
SAve /MAX C:\Users\Jack\Desktop\Game\Wc3\Tbr_Ranger.jpg
Exit
I would really appreciate it if someone helped me with this problem.
If file.txt is open then
save file.txt
else
open file.txt
End
If file.jpg is open then
save file.txt
else
open file.txt
I know basics of If statements but I have almost no experience with Batch files. I would really appreciate it If someone pointed me in the right direction of accomplishing my goal. I do not know exactly what kind of commands are available in this language of programing but I tried something with my basic knowledge. Here is what I got(it must look terrible to you experts)
@echo off
If[not] Ranger_Code.txt=open
START /MAX C:\Users\Jack\Desktop\Game\Wc3\Ranger_Code.txt
If[not] Tbr_Ranger.jpg=open
START /MAX C:\Users\Jack\Desktop\Game\Wc3\Tbr_Ranger.jpg
If Ranger_Code.text=open
SAve /MAX C:\Users\Jack\Desktop\Game\Wc3\Ranger_Code.txt
If Tbr_Ranger.jpg=open
SAve /MAX C:\Users\Jack\Desktop\Game\Wc3\Tbr_Ranger.jpg
Exit
I would really appreciate it if someone helped me with this problem.