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.
Changing Batch file command result
Moderator: DosItHelp
Re: Changing Batch file command result
Varcher00 wrote:Im trying to create pretty much a button that i can click to open or save 2 files at once.
Did you ever try to click onto a batch window? Have you ever seen buttons on a batch window?
Impossible by native batch!
I tried to write my own batch tool in C++ to get mouse clicks and their position. You will find it here.
At the moment I have no idea how you could find out if a text file is opend (maybe TASKLIST if all files are opend in different windows). And I'm virtually certain you can't save a file that is opened in a different application (maybe there is a text editor with an option to do this). There is no "remote control" in batch.
Regards
aGerman
Re: Changing Batch file command result
My bad, I'm just experimenting with different stuff like autohotkey, and this. Trying to find a sufficient program so that I may create this application for me. But I also want to gain knowledge from this experience. I did not know the boundaries of batch files, so I apologize for this mistake. But if u were to know of something that could help me in this task, I would appreciate it. Thank You