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: How to start schtasks to run batch file


13 Sep 2013   #1

Windows 7
 
 
How to start schtasks to run batch file

Hello,

I've been tring to make a scheduld task with schtask as system, i mannaged to do it and to task is succesfully made but there is a problem, the task need to run a batch file and it dosent doing it this is the command to add the task as SYSTEM

SCHTASKS /Create /SC daily /ST "17:00" /TN Task1 /TR "c:\myfolder\script.bat" /RU "SYSTEM"

after that i get this message:SUCCESS: The scheduled task "Task1" has successfully been created.

and the batch file code is:

@echo off
set TIMESTAMP=%TIME:~0,2%_%TIME:~3,2%_%TIME:~6,2%
echo Hello
echo change the button on %TIMESTAMP% > c:\myfolder\log.txt
start notepad.exe
RUNDLL32.EXE USER32.DLL,SwapMouseButton

and what is happing on 17:00 is nothing!
notepad dosent open, there is no Hello message and the mouse button are the same
the only thing that happend is in c:\myfolder\log.txt there is a text: change the button on 17:00

what is worng?
when i try to make the task as admin user it working
but i need it to be system beacuse in our company there only few computers and all the workers use the same computers with a username and password so i want it to task not realeted to any user so every user that use the computer can run it.

i need your help guys...

p.s
there is a way to start a task when getting a ping? so when someone will send ping to the computer it will start a scheduled task?

My System SpecsSystem Spec
.

Reply

 How to start schtasks to run batch file




Thread Tools




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 10:50 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33