Bettylou Posted October 28, 2016 Posted October 28, 2016 I know I'm going to kick myself for asking this but I can't find the answer anywhere. I have a compiled exe program that creates a notepad file on the desktop. But clients are complaining about having to double click the file to open it. They want it to automatically pop up open on the desktop. How do I automatically double click it? The file open command is - $colItems = "" $objWMIService = ObjGet("winmgmts:" & "{impersonationLevel=impersonate}!\\localhost\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", 0x30) If IsObj($colItems) then $File = FileOpen("MonthlyLog.txt", 2 + 8 + 128) For $objItem In $colItems FileWrite($File, "Running from:" & @ScriptDir & " " & "(" & @HOUR & ":" & @MIN & ":" & @SEC & " - " & @MON & "/" & @MDAY & "/" & @YEAR & ")" & @CRLF)
1957classic Posted October 28, 2016 Posted October 28, 2016 (edited) ShellExecute(@DesktopDir & "\MonthlyLog.txt") This would need to be added to your program. Edited October 28, 2016 by 1957classic
Bettylou Posted October 28, 2016 Author Posted October 28, 2016 Thanks. I'm doing more than kicking myself. there's quite a few swear words floating around here. I am so cheesed off at myself for being so stupid. I would have read that particular help file a dozen times. I added it to the end of the program and hey it works like a dream. EndFunc ShellExecute(@DesktopDir & "\MonthlyLog.txt") FileClose($File)
1957classic Posted October 29, 2016 Posted October 29, 2016 We've all been there and done that. Glad to help. Xandy 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now