Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Running bat file as scheduled task doesn't work in Vista

Posted on 2009-05-14
3
Medium Priority
?
441 Views
Last Modified: 2012-05-07
I am going crazy trying to sort out this issue.  I have a bat file that maps two network drives and then executes a vbs file (contents in code section).  It runs correctly from the command line but as a scheduled task it doesn't do anything.  Is say it completed successfully with code 0x0 but it didn't do what it was supposed to do.

I have "Run with highest privileges" checked.  I'm logged in as an administrator and I have the task scheduled to run with an administrator account.
net use H: \\wvdl1\wvdl-m\
net use Y: \\wvdl8\D$
cscript /nologo G:\BSEtoNAHLNonHK.vbs

Open in new window

5-14-2009-3-18-15-PM.jpg
0
Comment
Question by:hlking
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Expert Comment

by:sjl1986
ID: 24389414
It shouldn't make any difference, but I don't have Vista so I can't test it, but did you try renaming the .BAT to a .CMD file and running it that way? Like I said, it may not fix your problem but it's worth a shot.

Are you sure it is actually running? Do you see it pop up when it's scheduled time arrives? Another good way to trouble shoot it to put 'pause' after each line in the code and then sit there when it runs to see if anything in the code is causing it to fail. If the batch simply starts Vista will tell you that the file ran. The task scheduler has no idea what the file contains and if the file errors out and fails it will close prematurely even though the task scheduler thinks it completed because it stopped.
0
 

Accepted Solution

by:
hlking earned 0 total points
ID: 24389673
Argghh...the problem was the back slash at the end of my first NET USE command.  The reason it didn't fail when run from a command line is because I already had that drive letter mapped.  

Thanks for your ideas sjl1986.
0
 
LVL 8

Expert Comment

by:sjl1986
ID: 24389829
Ok. No problem. Glad you got it working.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi All Just a quick one for everybody. I was recently looking into setting the default User Account Picture for all my vista clients within the network but on closer inspection the group policy setting only allows you to set the default pictur…
So who is this article for? If you are like most of the computer users out there, you probably only realize the meaning of 'System maintenance' after something goes wrong. This article is for you if you care about keeping your system working opti…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question