Need help to run an exe without an open session
LinSkeZ
-
LinSkeZ -
LinSkeZ -
Hello,
I am stating my problem. I created an Excel macro that opens files, processes them, creates a summary file that then saves itself instead of being prompted in the macro.
Now that I have done this, I want to schedule its launch every week, on a specific day at a certain time. The issue is that there will be very few times when the session is open for security reasons.
Is it possible to run a .bat file that executes Excel and the macro without a session being open on the machine?
Best regards,
LinSkeZ.
I am stating my problem. I created an Excel macro that opens files, processes them, creates a summary file that then saves itself instead of being prompted in the macro.
Now that I have done this, I want to schedule its launch every week, on a specific day at a certain time. The issue is that there will be very few times when the session is open for security reasons.
Is it possible to run a .bat file that executes Excel and the macro without a session being open on the machine?
Best regards,
LinSkeZ.
2 answers
-
Hello,
This is typically a scheduled task: https://www.malekal.com/les-taches-planifiees-de-windows/. But does Excel allow running in batch mode without a graphical interface?
And do you already have a .bat file that launches Excel and runs your macro without intervention?
-
My .bat runs everything without human intervention; everything is automatic. I have created a scheduled task, but I need to set it up on a remote computer (server) that will rarely have a session open.
I'm currently trying to schedule it from my workstation, but my task starts (I'm not sure if I'm using the correct user), yet nothing executes when I close my session.
I'm not sure if I'm being very clear. -
You should start with a simple test, without Excel.
For example, a .cmd file that containsecho %time% >>D:\time.txt
Then create a scheduled task: Task Scheduler
- Create a basic task
- Name it
- Trigger set to daily, in 5 minutes
- Action: start a program
- Script: provide the afftime.cmd created with the above command (if you have a D: drive)
- Next
- Check "open the advanced properties..." + Finish
- Check "Run whether the user is logged on or not"
- Check: Run with highest privileges
- Provide the user's password
Verify that the task exists, in "Task Scheduler Library" (left column at the top)
Log off. Following this procedure, my task runs correctly even when I'm not logged in. -
-
I followed your advice by trying to simply launch Notepad, but when I log in with a session, the task runs but Notepad doesn't appear on the desktop. When I open my task manager, I can see that Notepad is indeed running, but only as a background process. Is it possible to launch it as a regular program?
Let me explain, when Notepad is launched by the task, is it possible for me to have an open Notepad on my desktop upon logging into my session as a result of my task execution? -
-
-
But does Excel accept to run in batch mode without a graphical interface?
Because the purpose of batch tasks is to start, execute, and finish without a screen and without intervention.