| 1. |
Solve : Help needed to write simple batch program? |
|
Answer» I need to create a batch program which will call a particular executable FILE, change some options in that file, and then execute it. What screens pop up exactly?Quote from: confusedgalvandana on March 19, 2009, 02:47:06 AM But this opens a window in which i have to select an option from the drop down list nt dos doesn't have drop-down list, so it's certainly a windows program. no, you can't click-clack-click windows prog from cmd.exe. another option is to write the code in wscript (already installed by default), or download 3rd party software, such as autoit, or write it in high-level language, such as VB, VC++, etc. which one do you prefer?Thank you for replying Yes, the program that i'm trying to run IS a windows program. Well actually, the application that we automatically want to invoke is itself coded in VC++, so i'm guessing i should somehow change the code of that application such that it takes the option i want by default? The problem i have though, is that the code is extremely complex to understand and i cant figure out where the code for the dropdown list exists among all the project files and workspaces... Can i code in VC++ the default options i want...and bypass the rest of the windows (2 of them) coz all i have to do is click "ok" on them both. I want to bypass that and move onto the third screen which is the actual executable. At the same time i want to auto-invoke that application....which is why i thought i should use batch programming. Any thoughts on this?if you have the source code, why would you code the 2 DialogBox in the first place? since it's not going to function anyway. Comment the line(s) where it create the instance of 2 DialogBox, then rebuild the executable. Quote from: confusedgalvandana on March 19, 2009, 06:44:10 AM At the same time i want to auto-invoke that application....which is why i thought i should use batch programming.create a shortcut in desktop or start menu??? this make me wonder if you did write the code yourself.I did not write any code in that application...it's an already existing application for which i downloaded the source code(freely available on the same site) and i have been working on for the past couple of weeks...i am just using the application...but i want it to conform to particular conditions....which it is not.. And by auto-invoke....i meant that it should start without any person having to click on it....the kind of application that i am developing needs a person to be monitored continuously...i want my program to check for a few conditions and if they are satisfied, i want this application to be invoked. The name of the application i'm working with is Machine Perception Toolbox(MPT). I have already mailed the authors of the software too....but awaiting reply. All i wanted to know was if its possible to write code such that in the first two windows "ok" option is selected so that directly the 3rd window is displayed.Quote from: confusedgalvandana on March 19, 2009, 07:21:19 AM And by auto-invoke....i meant that it should start without any person having to click on it....the kind of application that i am developing needs a person to be monitored continuously...i want my program to check for a few conditions and if they are satisfied, i want this application to be invoked. I may be wrong but it sounds like you are trying to have a program start and monitor what some one is doing with out them knowing. If so there are already programs out there that will do this. Is this for a company or home?Hey...no...the person knows he is going to be monitored...basically we are using a tool that allows us to monitor and count the rate at which a person blinks (which may SOUND kinda stupid! but thats what we wanna do).. Anyways the screenshots are attached. > In the screenshot, the first one opens automatically....i want to find a way to automatically select "blinkDetector" from the dropdown list and "ok" to be clicked so that it directly opens the 2nd dialog box. And this is not for any company, its a project i've taken up, thats all. Please help!! [attachment deleted by admin]In the first place, is it even possible to manipulate applications involving windows dialog boxes using batch programming?? Quote from: confusedgalvandana on March 19, 2009, 11:32:34 PM In the first place, is it even possible to manipulate applications involving windows dialog boxes using batch programming??from my few months experience in Batch, i am certain the answer is no. but if someone know how to control windows program from pure batch, i really realy want to know how to do it. here is the vbs code: (untested, i dont have the software) Code: [Select]with createobject("wscript.shell") .run "c:\program files\your exe program here",1,false:wsh.sleep 1000 if .appactivate("Projects") then .sendkeys "{down 4}~~" else wsh.echo "Unable to activate Projects" end if end with to run it double click the vbs file in windows explorer. or type in command prompt: cscript//nologo auto.vbs or wscript//nologo auto.vbs if you want to auto-invoke, you could put it in startup folder, or modify registry in the run section, or use a taskscheduler. because you have the source code, you could modify it also. but reading someone else source code is a very very tedious job. |
|