The best way is to schedule from schedule options it has inbuild, I used winXP schedule to run it at certain time the computer is idle or not over use, schedule at X day/time to run for an hour after that it will close it automatically, inside the program I schedule to run some minutes after Windows schedule opened the program, some time trimming takes maybe less than 10 minutes, just in case I scheduled it to be open for an hour, that will give enough time to finish doing its job.
Also I removed the auto start shortcut from Windows so it won't open when I log on, the schedule will do the job when I want it to.
UPDATE:
Since this method I guess requires the Samsung application to be opened (minimized), in some point it get lost calculating the days for schedule, I noticed at some point it was not working like it should, so optimization was not taking any effect, when task schedule opened Samsung application it was not doing the job, to fix this I made two tasks, the same for Samsung application with other settings and other that use Auto It script, so I removed the task from Samsung, once the Samsung application is opened used Auto It script to simulate mouse clicks and record the job where the optimization take place in Samsung's application, edited the time between mouse clicks and give in task scheduler enough time to let finish the process which I set it to run every 4 days in the morning when most time computer is idle.
This is the script I made:
Sleep, 60000
WinWait, Samsung Magician, Attach application l
IfWinNotActive, Samsung Magician, Attach application l, WinActivate, Samsung Magician, Attach application l
WinWaitActive, Samsung Magician, Attach application l
MouseClick, left, 93, 225
Sleep, 2000
MouseClick, left, 937, 240
MouseClick, left, 496, 484
Sleep, 600000
WinWait, Samsung Magician, Do you want to exit
IfWinNotActive, Samsung Magician, Do you want to exit , WinActivate, Samsung Magician, Do you want to exit
WinWaitActive, Samsung Magician, Do you want to exit
MouseClick, left, 109, 85
Sleep, 100
Both tasks will run together, the script will have enough time to wait until Samsung app has fully loaded, then will look for the window name and simulate like you were looking for the optimization tab, will press the process and will wait to finish then close the app, if fail closing it the task manager will close it.
Here’s the Task Scheduler setup:
![Task Scheduler setup](../../I/static/images/edcc35e631477e1f10e8dbe2b892c62969c5e4c8e682c0df8f6211a0646f9e56.png)
I have uploaded both tasks (jobs) + script file to Mega:
https://mega.nz/#!lso1GCYT!Xa964pMDTm34zOAe-c9j-x7JWvioa8EHDsJaRgixYpM
You could use both, in task manager just update the jobs' paths to point to Samsung app + script and you're done!
Download AutoHotkey to let you run the script:
https://autohotkey.com/download/1.0/AutoHotkey104805_Install.exe
Note: there are newer versions you could try, that's the version I have installed and giving this to make sure the script will work like it should.
1Is your SATA port set to IDE or AHCI mode? – Ramhound – 2013-07-17T15:26:56.553
run
fsutil behavior query DisableDeleteNotify
from cmd, is the result 0? – Raystafarian – 2013-07-17T15:32:42.293Samsung Magician says AHCI is on for the drive. And the DisableDeleteNotify is indeed 0. – Kenned – 2013-07-22T12:06:12.643