News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Running exe from inside of program

Started by Don57, October 06, 2012, 02:09:17 AM

Previous topic - Next topic

Don57

I wrote a small batch file to erase the windows event logs, of which there are many. I want to place the executable inside a GUI interface.
I essence have the programrun from a GUI interface.

jj2007

invoke WinExec, chr$("testthis.bat"), SW_SHOW

(There are more complicated solutions, too)

Don57

Thank you. I'm interested in other solutions as well, because I don't want the DOS windows to show.

jj2007

Quote from: Don57 on October 06, 2012, 02:26:05 AM
I don't want the DOS windows to show.

Use SW_HIDE (but beware of hanging DOS apps - for testing, I would use SW_MINIMIZE; besides, some minimal feedback to the user is not necessarily a bad thing...).

Vortex

Hi Don57,

What's wrong with the Windows Event Log Functions?

http://msdn.microsoft.com/en-us/library/windows/desktop/aa385784(v=vs.85).aspx

Another question : why do you wish to delete the events silently?

Don57

I load and test various OS's and programs on my computer, as a result things go bad sometimes, and the Adminstrators log keeps building. There is no way to delete this log from the event viewer, so this was my solution.

Vortex

This vbs script clears the Application log without displaying a console :

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Backup)}!\\" & _
strComputer & "\root\cimv2")
Set colLogFiles = objWMIService.ExecQuery _
("SELECT * FROM Win32_NTEventLogFile WHERE LogFileName='Application'")
For Each objLogfile in colLogFiles
  objLogFile.ClearEventLog()
Next

hfheatherfox07

#7
@ Don57
Here is an example that I did not even remember having ....
It creates a batch files and than deletes it ...you never see a dos window  :biggrin:

you can modify the batch file to delete your log

----EDIT----
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

sinsi

>There is no way to delete this log from the event viewer
Right-click, clear log

Don57

I am runninng windows 7 64 bit and the clear log option is nowhere to be found for the administrators log.

Vortex

Hi Don57,

Could you please check the links below?

http://www.learnwithnirab.com/2011/10/how-to-clear-event-viewer-log-in.html

http://www.thewindowsclub.com/how-to-view-and-delete-event-viewer-saved-logs-in-windows-7

Don57

Thanks.  :t  The first one I already knew, but the second one that path doesn't exist in my version of windows 7 64x Ultimate

C:\ProgramData\Microsoft\Event Viewer\ExternalLogs     no ExternalLogs

The only problem is the Administrative Events log, with no clear function. With help from the forum putting together a little app to do that. If I have some free time next weekend I should finish it. I'd rather have it in an exe than a batch file so I can't alter it accidently.