• Status: Solved
  • Priority: Low
  • Security: Public
  • Views: 120
  • Last Modified:

Schtask /change in windows 7 to change start time without specifying a user/pw

Trying to edit the time of a schedule task (windows 7) via a batch file with schtasks

The task is set to "Run only when user is logged on"

I cant figure out anyway to use schtask /change without specifying a user/pw, which then disables that setting and sets it to run whether user is logged on or not.

When I try something like

schtasks /change /tn name /st 20:00 /rp

leaving remote pw blank.. it says "Logon failure: uknown user name or bad password"
0
bail3yz
Asked:
bail3yz
  • 4
  • 3
  • 3
1 Solution
 
65tdRetiredCommented:
Have you tired the system account?
0
 
bail3yzAuthor Commented:
Yes, but then it will run whether the account is logged in or not, which is not what I want.

Seems so silly you cant edit the time without changing the credentials / the way it runs lol

I am hoping there is a solution, but I dont think there is...
0
 
65tdRetiredCommented:
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
bail3yzAuthor Commented:
Yes, it is of no help for this situation.
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
I know that does not help, but it works as expected in W10.
In W7 i got it working once only by applying /IT after the /ST change  for testing here, but I cannot repeat.
Also remember schtasks is intended to work for simple tasks only - it cannot cope with the complex architecture introduced with Vista, like more than on trigger and action. So it is likely it does not work well or at all with your tasks ;-).

Probably you'll have to use a cycle of   export task - delete task - edit XML - import XML   . But doing the XML change in a batch file isn't easy, if you do not know exactly what to find and replace. PowerShell is better suited for that with its native XML support.
However, it is easy if you know the options for creating the scheduled task: Then I would just delete and recreate with new options.
0
 
bail3yzAuthor Commented:
Ya figured I would end up having to do that!

Annoying, for such a small thing!

Thanks tho!
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
I don't think a link to the schtasks cmd description should be an accepted answer. The questions hasn't been about syntax but real-life experience about what really works. So my comment should be accepted only.
0
 
65tdRetiredCommented:
In regards to Qlemo comment "but real-life experience about what really works", should be disregarded.

When working in the "field" (real life), using command tools is very useful configuring, reviewing Task scheduler settings and works.
Granted the Windows 10 interface is considerably better than previous version of the OS.
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
There seems to be a misunderstanding.
I have been talking about schtasks only. My suggestion to export/delete/edit file/import, or recreate the task, are all meant to be based on that tool. No GUI required (but could be used instead).
0
 
65tdRetiredCommented:
OK I misunderstood your comment.
The later GUI's are excellent for the operations mentioned in your post.

Enjoy
0

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now