Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Schtasks not working properly, Windows 7

25 Oct 2012   #11

Windows 10 Pro X64

What account is it running under when scheduled? Make sure it's yours perhaps?

My System SpecsSystem Spec
26 Oct 2012   #12

Windows 7 Ultimate x64

Yes, sure it's mine. There is only one account on my notebook.
My System SpecsSystem Spec
26 Oct 2012   #13

Windows 10 Pro X64

Many scheduled task run under System, not your account, which is why I asked. You may want to double check as it sure sounds like that may be the problem.
My System SpecsSystem Spec

28 Oct 2012   #14

Windows 7 Ultimate x64

Computer detective task runs on my account.
My System SpecsSystem Spec
28 Oct 2012   #15

Windows 10 Pro X64

Computer Detective? I thought we were talking about your batch file?

What I meant was, if you open Task Scheduler, does it show your account name or SYSTEM?

Schtasks not working properly, Windows 7-schedsys.jpg

My System SpecsSystem Spec
28 Oct 2012   #16

Windows 7 Ultimate x64

Scheduled task "Computer Detective", which runs ks1.bat every x minutes is running on my account.
My System SpecsSystem Spec
28 Oct 2012   #17

Windows 10 Pro X64

AH, okay. So you are not running ks1.bat directly from the scheduler. That was not obvious from what you had posted previously.

Most likely, when Computer Detective launches ks1.bat, the default directory is the one Computer Detective is in, not where ks1.bat is, unless they are in the same place.

Create a new, temporary ks1.bat that does this:

dir * > C:\Users\youraccount\Desktop\Whatdir.txt

Run it from Computer Detective and see what is in Whatdir.txt when it ends.
My System SpecsSystem Spec
29 Oct 2012   #18

Windows 7 Ultimate x64

@echo off
cd results
md %date%
cd %date%
echo Computer detective is running...
echo Copying active files list...
dir * > C:\Users\Neone\Desktop\Whatdir.txt
echo Task completed. Computer detective closes...
ping -n 3 >nul
 Volume in drive C is Windows
 Volume Serial Number is 8619-62BF

 Directory of C:\Windows\2012.10.29

2012.10.29  09:51    <DIR>          .
2012.10.29  09:51    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)  267.091.505.152 bytes free
Part of main ComputerDetective.bat
echo Input txt files update time in minutes:
set /p minutes=
cd Computer detective
cd tasks
schtasks /create /sc minute /mo %minutes% /tn "Computer Detective" /tr %homedrive%%homepath%\Desktop\OSND\ComputerDetective\tasks\ks1t.bat

How my files are arranged:

dir of osnd:
 Volume in drive C is Windows
 Volume Serial Number is 8619-62BF

 Directory of C:\Users\Neone\Desktop\osnd

2012.10.25  16:53    <DIR>          .
2012.10.25  16:53    <DIR>          ..
2012.10.25  16:09    <DIR>          Tools
2012.10.21  15:54    <DIR>          ComputerDetective
2012.10.25  16:48               934 UsefulTools.bat
               2 File(s)        113.317 bytes
               4 Dir(s)  267.092.324.352 bytes free
Tools - here all programs which are being run by UsefulTools.bat are located
ComputerDetective - here files of ComputerDetective are stored. In tasks subfolder there is ks1.bat, and other ks's. In results subfolder results of ks's.
UsefulTools - this is main batch file which runs other batch files from Tools directory, and one of them is ComputerDetective.bat
My System SpecsSystem Spec
29 Oct 2012   #19

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM

Don't mean to jump in and confuse the issue, but have you used Task History to see if there are any error messages?

When i have a problem with a scheduled task here is what i do:
1) Enable All tasks History
2) Manually run the task from the scheduler
3) Look at the History tab for the task
Click refresh until the task is completed
Check each step in the task looking for error(s)
Check and enable other logs if needed
Find a fix for any error(s)
Re-run the task
4) Disable All tasks History when all errors are resolved and the task works

Schtasks not working properly, Windows 7-taskschsp01.png

I also make sure the BAT file works on it's own before trying to debug a scheduled task that runs a BAT file.

My System SpecsSystem Spec
29 Oct 2012   #20

Windows 7 Ultimate x64

There is no error messages. Everything now works fine, just ks1.bat creates folder and txt file in C:/Windows, not in ../osnd/ComputerDetective/results

Tomorrow I need to show this program to my lecturer and I'll get mark for it. So I am waiting for last suggestions..
My System SpecsSystem Spec

 Schtasks not working properly, Windows 7

Thread Tools

Similar help and support threads
Thread Forum
Browsers not working properly on windows 7
I have two problems. when I use internet explorer, it constantly flickers, especialy during videos. When I use google chrome it doesn't flicker but youtube freezes up
Browsers & Mail
Windows update not working properly.
Every time I click on Windows update it brings up the program, but the program is blank. Here's a picture of it to better show my problem. Diagnostic Report (1.9.0027.0): ----------------------------------------- Windows Validation Data--> Validation Code: 0 Cached Online Validation Code:...
Windows Updates & Activation
windows not working properly
Installed Windows 7 on a new build-ssd. Windows loaded and worked properly, and was able to access anything I tried to. Installed driver for graphics card. After restart, windows shows desktop background. No icons and unable to open start menu from windows key. I am able to right click...
BSOD Help and Support
Windows Aero not working properly
Hi I have Windows 7 Ultimate 32-bit and yesterday it decided to revert to Windows basic after I launched a game and didn't go back to Aero after I quit. After a bit of digging around I managed to get the effects working again by restarting WDM and Themes services but I still get that horrible...
Themes and Styles
HIQ Recorder on Windows 7 not properly working
I recently installed Windows 7 on my computer, Dell Vostro 1400. Now the HIQ recorder (roemersoftware) and skype do not work properly. The recorder records all sounds: from the mp3 file and from the microphone. When I mute the microphone the recorder software tells me i do not have a sound card....
Sound & Audio

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 09:14.
Twitter Facebook Google+