There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
DOS/PDA/Other
Tag Cloud
backup bios boot bsod computer connection crash dell driver drivers email error excel firefox freeze hard disk hard drive hardware hijackthis internet kb977165 keyboard laptop linksys macro malware network outlook outlook 2003 outlook 2007 password problem recovery router server slow sound toshiba trojan usb video virus vista vpn windows windows 7 windows vista windows xp wireless youtube
Search
Search for:
Tech Support Guy Forums > Operating Systems > DOS/PDA/Other >
Windows XP Task Scheduler Command Line Credentials Question

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
scrfix's Avatar
Computer Specs
Senior Member with 306 posts.
 
Join Date: May 2009
Experience: Computer Repair Expert
18-Aug-2009, 01:44 AM #1
Windows XP Task Scheduler Command Line Credentials Question
Before I embark on this, I am wondering if anyone here knows of any way to get the Task Scheduler in XP to not require credentials even when there is a password on the account.

I already know I can set the registry so that I can have no password on the account and then allow the credential check for the task scheduler to be blank. That I have and have working.

My hopes are that I can set the scheduler up and not have to enter a password at all and even if the client machine has a password, the scheduler will still run.

My only other option is to change their password to nothing and then prevent the client machine from changing their password so it doesn't screw up the task scheduler. I don't want to go down that path.

Any ideas?
I saw that I can use /ru SYSTEM. If I did that, would I still have to enter a password?

Thanks for any tips,

Updated:
Okay, this question has been semi-resolved.
1. I realized that I was not checking the "only run if logged in" checkbox. Now it doesn't rely on password credentials to run.

2. Next question. I am sure there is a way via the command line to check that box however I am not sure what it was. The closest thign I could find was the /NP key for no password however even then it said only local limited resources available if I do that.

I am using schtasks for this.

3. I read that schtasks is not available in Home Edition XP. I don't have a home edition here with me to test currently so I am asking here. Is that true? If so, I will need to add that to my list as well and will have to check for that file on XP systems.

Update2 08-18-09
It appears I am out of luck with utilizing the schtasks in Windows XP. I have attempted to bring the one from Vista and it of course errors out saying it is not a valid Win32 application.

I did have a thought however.

My Goal
To have an interactive exe file ran daily on a computer at a specified time without credential check.
I believe I can utilize the AT Commands for this on XP. Am I wrong?
If I utilize AT for this task, am I wasting my time or can I accomplish the above?
__________________
Wayne Leiser, Spectacular Computer Repair Computer Repair, Computer Services
World Famous Gift Baskets: Gift Baskets, Corporate Gifts
Resources LLC: Water Treatment Coagulation, Water Recycling

Last edited by scrfix : 18-Aug-2009 09:17 AM.
Squashman's Avatar
Trusted Advisor with 15,871 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
18-Aug-2009, 04:13 PM #2
I would just use AT.
TheOutcaste's Avatar
Computer Specs
Trusted Advisor with 6,923 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
18-Aug-2009, 06:48 PM #3
The System account does not require a password. Tasks run under the System account will not be interactive.
XP Home does not include schtasks.exe, but the one from XP Pro seems to work
I don't think you can set the Run only if logged on box from the command line. Seems like a strange oversight
Never heard of the /NP switch, and it fails on XP. Perhaps you meant /RP?
AT works for XP Home
__________________
Microsoft MVP - Windows Desktop Experience
Of course I know all the answers ; I just don't always match the answers to the right questions

scrfix's Avatar
Computer Specs
Senior Member with 306 posts.
 
Join Date: May 2009
Experience: Computer Repair Expert
18-Aug-2009, 10:17 PM #4
Jerry,

The /NP is from Vista. I thought it was available in XP too however that was an incorrect presumption. Works the same as the System except for the user. Does not run interactively.

I am going to attempt something. If I create a batch file and have that call a separate batch file, I wonder if that second one will run interactive. Perhaps the first one will be interactive and who cares.

I will report back with what I find.

Squashman,
If I utilize the AT command, can I get around having to use a password to run the command?

Notes:
My main concern is the fact that I don't want to have to worry when someone changes their password. I don't want to have to change the password in the task.

I know that I can remove their password with net user "%username%" ""
I can then prevent the user from adding a password with net user "%username%" /passwordchg:no
Finally I can change the registry entry limitblankpassworduse to 0 and then I can enter a blank password for the schtasks and not have to worry about a password change.
I can provide a utility for changing passwords at that point in time.

I didn't want to have to go through all of that... lol
I am hoping to get around having to use credentials to run either AT or SCHTASKS.
The preferred method is to still allow user the ability to change their password.

Updated:
The AT command appears to do exactly what I need. One question however. When I create the command:
AT 00:23 /INTERACTIVE /EVERY:M,T,W,Th,F,S,Su "MyPerfectFile.exe"
It saves it as AT1.job inside the Windows/Tasks folder. I would like this to be named something else other than AT1.job such as whatever.job. I went to the command line and did a ren AT1.job whatever.job and it successfully renames however it at that time does not run at its scheduled time.

Does it have to stay named AT1? I wouldn't think the name would have anything to do with the commands. If I leave it as AT1, it works just fine. Any ideas?
__________________
Wayne Leiser, Spectacular Computer Repair Computer Repair, Computer Services
World Famous Gift Baskets: Gift Baskets, Corporate Gifts
Resources LLC: Water Treatment Coagulation, Water Recycling

Last edited by scrfix : 18-Aug-2009 11:30 PM.
TheOutcaste's Avatar
Computer Specs
Trusted Advisor with 6,923 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
18-Aug-2009, 11:22 PM #5
Create a separate account for running scheduled tasks, then add it to the Special Accounts list. It won't show on the Welcome screen or the User Control Panel. It will show in the Local Users and Groups snap in and in Net User, but XP home and Vista Home/Basic don't have that snap in, so it hides it fairly well. Add a comment that the account shouldn't be deleted or have it's password changed and maybe it will be left alone.
__________________
Microsoft MVP - Windows Desktop Experience
Of course I know all the answers ; I just don't always match the answers to the right questions

scrfix's Avatar
Computer Specs
Senior Member with 306 posts.
 
Join Date: May 2009
Experience: Computer Repair Expert
19-Aug-2009, 12:29 AM #6
I spoke too soon.

I am having a massive issue with this AT command. It will not see a mapped drive apparently.

I am using robocopy.
In order to begin the robocopy, I merely check to see if the drive is actually there.

Code
Code:
@echo off
IF NOT EXIST Z:\ GOTO _NODRIVEFOUND
IF EXIST Z:\ ECHO We Have a drive.
GOTO _PAUSE
:_NODRIVEFOUND
Echo There must be a problem with AT commands over a network.
GOTO _PAUSE
 
:_PAUSE
pause
The Z Drive is an external hard drive hooked up to another computer on a workgroup.

If I click on the bat file above directly, it works no problem. If I use the AT command, it fails every time with and without quotes around the Z:\

Any ideas?

Updated
Sorry, I am starting to pass out over here. Too tired from the main job. I forgot to give you my AT command.
Here, I have tried the following:

AT 01:07 /INTERACTIVE /EVERY:M,T,W,Th,F,S,Su "C:\Program Files\Spectacular Computer Repair\testat.bat"

AT 01:07 /INTERACTIVE /EVERY:M,T,W,Th,F,S,Su C:\Progra~1\Specta~1\testat.bat

Change the time to your liking.

Am I missing something? Why will this not work when AT handles it and it does work when I click on it or run it from the command line?
__________________
Wayne Leiser, Spectacular Computer Repair Computer Repair, Computer Services
World Famous Gift Baskets: Gift Baskets, Corporate Gifts
Resources LLC: Water Treatment Coagulation, Water Recycling

Last edited by scrfix : 19-Aug-2009 12:45 AM.
scrfix's Avatar
Computer Specs
Senior Member with 306 posts.
 
Join Date: May 2009
Experience: Computer Repair Expert
19-Aug-2009, 01:25 AM #7
Jerry,

You gave me a good idea. Tell me if this is possible before I waste my time doing this.

This is for stand alone systems and not for a domain.

Step 1: I set the registry entry so that it can accept blank passwords.
Step 2: Under an administrator account, I can erase the password for the Administrator account.
Step 3: I make it so that the administrator password cannot be changed.
Step 4: I shedule the task to run with Administrator Credentials.

I could also modify that by creating a random password and changing the Administrator account to be a random password. I could place a document file on their desktop somewhere stating what the Administrator password is.

Thoughts?

Off to bed for me.
__________________
Wayne Leiser, Spectacular Computer Repair Computer Repair, Computer Services
World Famous Gift Baskets: Gift Baskets, Corporate Gifts
Resources LLC: Water Treatment Coagulation, Water Recycling
scrfix's Avatar
Computer Specs
Senior Member with 306 posts.
 
Join Date: May 2009
Experience: Computer Repair Expert
19-Aug-2009, 01:48 AM #8
Okay,

I haven't gone to bed yet. I think I found something. I believe I just have to compile it and test it. On sourceforge there was some open source software for task scheduler that creates .job files and allows me to utilize run only if user is logged on. It took me forever to find that. NOBODY made one that had a command line interface. It was all GUI. Some really nice stuff, but not command line.

Link: http://sourceforge.net/projects/pyta...3.zip/download

If I can utilize that, my issues will be resolved.
__________________
Wayne Leiser, Spectacular Computer Repair Computer Repair, Computer Services
World Famous Gift Baskets: Gift Baskets, Corporate Gifts
Resources LLC: Water Treatment Coagulation, Water Recycling
Squashman's Avatar
Trusted Advisor with 15,871 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
19-Aug-2009, 04:30 PM #9
Quote:
Originally Posted by scrfix View Post
I spoke too soon.

I am having a massive issue with this AT command. It will not see a mapped drive apparently.
On Vista?
http://www.winhelponline.com/blog/ma...ompt-in-vista/
scrfix's Avatar
Computer Specs
Senior Member with 306 posts.
 
Join Date: May 2009
Experience: Computer Repair Expert
19-Aug-2009, 07:39 PM #10
Quote:
Originally Posted by Squashman View Post

No. XP.
TheOutcaste's Avatar
Computer Specs
Trusted Advisor with 6,923 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
19-Aug-2009, 07:55 PM #11
Drives are mapped on a per user basis. Anything scheduled using AT runs under the System account, so it won't see drives mapped under any other accounts. You'll have to map the drive from within the task itself.

If you use Net Use /persistent:yes, the drives will remain mapped even after a reboot, so they would only need to be mapped once for the System account.
__________________
Microsoft MVP - Windows Desktop Experience
Of course I know all the answers ; I just don't always match the answers to the right questions

scrfix's Avatar
Computer Specs
Senior Member with 306 posts.
 
Join Date: May 2009
Experience: Computer Repair Expert
19-Aug-2009, 08:14 PM #12
hmmmmm,

Jerry, I then have another question which will actually help me out in a few ways but currently more for learning and here at home.
1. How do I map a drive from a batch file?
2. Is there a way that I can detect a shared resource.

Example:
My son's computer has an external drive attached to it.
That drive on his computer is drive f:\
That drive is shared on the network.

Is there a way to automatically
1. Detect that shared resource.
2. Be able to distinguish that it is an external drive instead of just a shared folder on the system root.
3. Map it to a drive letter that is not currently in use on my computer local computer.
__________________
Wayne Leiser, Spectacular Computer Repair Computer Repair, Computer Services
World Famous Gift Baskets: Gift Baskets, Corporate Gifts
Resources LLC: Water Treatment Coagulation, Water Recycling
Squashman's Avatar
Trusted Advisor with 15,871 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
19-Aug-2009, 08:20 PM #13
Quote:
Originally Posted by scrfix View Post
hmmmmm,

Jerry, I then have another question which will actually help me out in a few ways but currently more for learning and here at home.
1. How do I map a drive from a batch file?
He just showed you how. net use.

You map a drive to another computer by using the computer name and share name.
\\computername\share

So there is no real reason to try and detect it remotely.
Squashman's Avatar
Trusted Advisor with 15,871 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
19-Aug-2009, 08:23 PM #14
I forgot to add. If you want to map it to the next available drive letter you just use an asterisk in place of the drive letter.

net use * \\computername\sharename
scrfix's Avatar
Computer Specs
Senior Member with 306 posts.
 
Join Date: May 2009
Experience: Computer Repair Expert
19-Aug-2009, 08:36 PM #15
Can it be done however? If I wanted to automatically detect the network shares. Can it be done?

(I just got your second post on my cell. Thanks. I was just looking that up with net use /?) I didn't realize that net use was how to map it. I thought it was just talking about the persistent yes.

I am curious if it the network shares can be detected automatically, if so, how. I am also curious if from the command line it is possible to determine whether that shared resource is an external drive and finally if it is possible to automatically assign a drive letter to it that is not in use on the current user.

If that is possible, I would like to incorporate that at work when backing up peoples data over the network. That would make things so much easier. That's why I mentioned that if it is possible, that would help me out in a few different ways however I can also utilize that here at home too.
__________________
Wayne Leiser, Spectacular Computer Repair Computer Repair, Computer Services
World Famous Gift Baskets: Gift Baskets, Corporate Gifts
Resources LLC: Water Treatment Coagulation, Water Recycling
Closed Thread Bookmark and Share   techguy.org/853281

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 02:07 PM.
Copyright © 1996 - 2010 TechGuy, Inc. All rights reserved.
Powered by Cermak Technologies, Inc.