Re: Run .bat as Scheduled Task doesn't work, but manual execute wo

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Bonj (benjtaylor)
Date: 11/06/04


Date: Sat, 6 Nov 2004 16:56:37 -0000

cd\CWDScripts
could have dependency on the directory that the batch file is started in,
which could differ if it's run by the task scheduler.

"hking" <hking@discussions.microsoft.com> wrote in message
news:E1480F97-CD85-4207-8ACF-D7C52A6FAA34@microsoft.com...
> This is my bat file:
>
> net use R: /delete
> net use R: \\wvdl89\cwd
> d:
> cd\CWDScripts
> cscript /nologo ProcessCWDResults.vbs
> net use R: /delete
>
> The script does some various things with windows script host and does
> some
> work with Excel and Access. It seems to hangup when it opens the Access
> application and calls a procedure located in an Access module.
>
> I can't figure out what the difference is between executing the bat file
> manually versus as a scheduled task.
>
>
> "Veign" wrote:
>
>> What hangs? the .bat file or the script?
>>
>> What does the script do, the .bat file do?
>>
>> --
>> Chris Hanscom - Microsoft MVP (VB)
>> http://www.veign.com
>> --
>>
>> "hking" <hking@discussions.microsoft.com> wrote in message
>> news:9FEA5DDA-12B2-4F8B-A238-DB15141375EE@microsoft.com...
>> > I have a vb script that is executed from a .bat file. When I fire off
>> > the
>> > .bat file manually it works fine. When I run it as a Scheduled Task
>> > using
>> > CMD.exe it almost finishes and then hangs. I'm using the same admin
>> account
>> > for both scenarios. This is after a Windows Server 2003 upgrade. Any
>> > thoughts?
>>
>>
>>



Relevant Pages

  • Re: Script to Send Email If Network Drive Low on Disk Space
    ... I copied an existing *.bat file, removed its contents and copied the ... To what do I copy and paste your script? ... You can save the code into any file with a .bat extension, ... the Task Scheduler to run it once or twice each day. ...
    (microsoft.public.windowsxp.general)
  • Re: Copy files to another computer
    ... Don't use at.exe - use the Task Scheduler! ... I have bat file which use robocopy. ... >> You could schedule a task using the XCOPY command, ROBOCOPY. ... >>>the script. ...
    (microsoft.public.windows.server.general)
  • Re: ScreenSaverGracePeriod
    ... Because the regkey correspondents to HK LOCAL MACHINE run it as a startup script not as a logon script. ... The user will have no rights to modify the registry. ... This posting is provided "AS IS" with no warranties, and confers no rights. ... I created a bat file and a registry file and and set it all up ...
    (microsoft.public.windows.server.active_directory)
  • Re: Task Scheduler job Hangs (rundll32 printui.dll,PrintUIEntry)
    ... I modified my batch file to include your recommendation. ... The bat file ... related to a batch job hanging when initiated via Task Scheduler. ... I take the same batch job and initiate it with the ...
    (microsoft.public.windows.server.general)
  • Re: Mapped Drives and Home Folders
    ... In Active Directory Users and Computers, ... On the Logon script line, ... name of the .bat file - do not include a path. ... Put it a shared folder with read only access. ...
    (microsoft.public.windows.server.general)