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
Ztruker

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
neone

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
Ztruker

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
neone

Windows 7 Ultimate x64
 
 

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

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
neone

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
Ztruker

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
neone

Windows 7 Ultimate x64
 
 

ks1t.bat
Code:
@echo off
cd..
cd results
md %date%
cd %date%
echo Computer detective is running...
echo.
echo Copying active files list...
dir * > C:\Users\Neone\Desktop\Whatdir.txt
echo Task completed. Computer detective closes...
ping -n 3 127.0.0.1 >nul
exit
Whatdir.txt
Code:
 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
Code:
echo Input txt files update time in minutes:
set /p minutes=
cd..
cd Computer detective
cd tasks
schtasks /create /sc minute /mo %minutes% /tn "Computer Detective" /tr %homedrive%%homepath%\Desktop\OSND\ComputerDetective\tasks\ks1t.bat
echo.

How my files are arranged:

dir of osnd:
Code:
 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
DavidE

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64
 
 

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
neone

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
Reply

 Schtasks not working properly, Windows 7




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Windows Explorer is not working properly.
Hi everybody. Dr. Nick I have a problem for about 1 month, and i haven't got rid of it. When I start Windows 7, it works fine for a random time (it can be 15 minutes, it can be 5 hours) But when it happens, i get this when I do some actions like Opening "Computer": Picture 1 Opening...
General Discussion
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 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
My Windows Explorer is not working properly
I'm using windows 7 ultimate version 6.1 ,wen i start my computer it logon but after nothing is displayed, only blank screen is displayed. but i can operate the system via task manager, for ex:to open the logical drive i wil press ctrl+alt+del ->taskmanager->new task->run->e: ,then my logical drive...
BSOD Help and Support
9500GT not working properly in Windows 7?
I am coming to Windows 7 from Vista 64bit Ultimate. On Vista I was able to get aero enabled and my system scored a 4.7 on the winsat tests. When I did a clean install and went to Windows 7 Ultimate 64bit, my aero doesn't want to initiate. I also cannot complete my winsat test because when it...
Graphic Cards


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 03:32.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App