School Project,Gui,more

Hello,

I would like to make a simple gui that would execute bat files.By pressing on the appropriate buttons,a bat file will run that will setup an auto check of the hard drive and ram of the computer each 3 months.After this having been done,the log files will be transmitted to a locally hosted website.This is on a lan system,all the computers will be listed with the status of their hard drives and ram ( OK or bad.)

I would like to say that i am a simple student except some calculator and basic game i did nothing else in C + +.This is why i thought of using something to facilitate my task and i found QT gui.I never made a gui before so i wonder if the task is doable for me.I have a 2 months deadline with approx 3 hours per day.

I would need support on how to make the gui and make it execute the bat files,how to automatically output txt files of the ram and hdd test then parse each line.If the key-sentence "No further actions is required" is found then the status will be set as OK else it will be set as PROBLEM DETECTED.

I do not mind using plugins and other things to facilitate my task.

I would appreciate support,recommendations and counsil. I do not even know if this is the correct category or even forum to ask help but i did not have a better idea.I would appreciate support.
QT is fairly simple, and portable but you said bat files, and bat files means windows, so visual studio's gui editor may be for you. Either one will work fine; visual is a little more polished.

execute bat files is just a call to do just that. you can set up one of the window's system calls to NOT spawn a console window when it fires off a bat file; I think shellexecute family can do that? Then it will run it silently in the background, or you can use system() and let it spawn the console to see the output, your call. This is the easy part, do not consider it in your efforts, its 5-10 min of web research and typing in a command or two.

you can redirect the output of a batch file to a text file that you can parse, and I believe some of the ways to invoke console programs can also capture their output, your choice, the above research can set you up on that, so add another half an hour to pick your tool that does it the way you want to.

so the hard part is to make your gui, so maybe, focus on that first and early so you can decide if you want to use QT or something else as soon as possible. Grab a tutorial and build a small gui that does what you say on a button press and has some text areas, eg try to make hello world gui where punching a button prints the text hello world over in a text output widget (text box type widget). Get this stuff like you want it and then code the batch file stuff into what you learned after.

I feel compelled to tell you that it is considered bad practice to call batch files from programs. the reason is that a hacker can replace the code in the batch file and your program will do something it should not, using its credentials, to run things the hacker may not have had the credentials to run himself -- perhaps simply granting himself more authority, or installing malware, or whatever else. I do it all the time on my personal computer as mixing and matching the command line tools into a program is a quick way to automate simple things in a tiny bit of code, but its a liability on a public system or corporate system etc. Be sure whoever asked for this understands the risks. You can write the batch file yourself from the code and then run it, that is a little safer; if someone modifies it, you repair it before running it each time and they would have like 1 nanosecond window to break things.

Last edited on
It sounds like you are trying to create a “launcher” — an application that starts other applications.

I would use Tcl/Tk for this.


[edit]
Do the batch files require user input of any kind? Like "pause" statements or anything?
Or are they fully automated?

Does the user need to see the script running?
Or can it happen in the background, invisible?
Last edited on
Topic archived. No new replies allowed.