Jump to content

Single instance of Scheduled Task


Recommended Posts

Guest Jim Brown
Posted

Is there a way to have a Scheduled Task that does not start if it’s already

running?

 

I create scheduled tasks that start a MS Access project database to do some

processing. But if it’s not complete by the next start time, it needs to skip

that scheduled start. I can’t do this in VBA code because since it’s a

project/adp database you get the “database will be opened read only” dialog

box before any of your code runs.

  • Replies 4
  • Created
  • Last Reply

Popular Days

Guest Pegasus \(MVP\)
Posted

Re: Single instance of Scheduled Task

 

 

"Jim Brown" <jb@applicationsplus.com.(donotspam)> wrote in message

news:FD21F97A-1967-442A-AD6E-05E5226F32B0@microsoft.com...

> Is there a way to have a Scheduled Task that does not start if it's

> already

> running?

>

> I create scheduled tasks that start a MS Access project database to do

> some

> processing. But if it's not complete by the next start time, it needs to

> skip

> that scheduled start. I can't do this in VBA code because since it's a

> project/adp database you get the "database will be opened read only"

> dialog

> box before any of your code runs.

>

 

Instead of getting the scheduled task to open the data base directly,

get it to run the following batch file:

 

@echo off

tasklist | find /i "msaccess" && goto :eof

"c:\program files\...\msaccess.exe" "d:\My Files\Database.mdb"

Guest Jim Brown
Posted

Re: Single instance of Scheduled Task

 

OK, I see where your going with that. However there are several databases

that get launched this way on the same box. That's only going to indicate

that "some" copy of MSACCESS is already running, correct?

 

"Pegasus (MVP)" wrote:

>

> "Jim Brown" <jb@applicationsplus.com.(donotspam)> wrote in message

> news:FD21F97A-1967-442A-AD6E-05E5226F32B0@microsoft.com...

> > Is there a way to have a Scheduled Task that does not start if it's

> > already

> > running?

> >

> > I create scheduled tasks that start a MS Access project database to do

> > some

> > processing. But if it's not complete by the next start time, it needs to

> > skip

> > that scheduled start. I can't do this in VBA code because since it's a

> > project/adp database you get the "database will be opened read only"

> > dialog

> > box before any of your code runs.

> >

>

> Instead of getting the scheduled task to open the data base directly,

> get it to run the following batch file:

>

> @echo off

> tasklist | find /i "msaccess" && goto :eof

> "c:\program files\...\msaccess.exe" "d:\My Files\Database.mdb"

>

>

>

Guest Pegasus \(MVP\)
Posted

Re: Single instance of Scheduled Task

 

Same thing:

@echo off

tasklist /v | find /i "Database1" && goto :eof

"c:\program files\...\msaccess.exe" "d:\My Files\Database1.mdb"

 

Sometimes you have to nose about a bit . . .

 

 

"Jim Brown" <jb@applicationsplus.com.(donotspam)> wrote in message

news:7079F699-46FF-4F0A-958F-92362F5AF40C@microsoft.com...

> OK, I see where your going with that. However there are several databases

> that get launched this way on the same box. That's only going to indicate

> that "some" copy of MSACCESS is already running, correct?

>

> "Pegasus (MVP)" wrote:

>

>>

>> "Jim Brown" <jb@applicationsplus.com.(donotspam)> wrote in message

>> news:FD21F97A-1967-442A-AD6E-05E5226F32B0@microsoft.com...

>> > Is there a way to have a Scheduled Task that does not start if it's

>> > already

>> > running?

>> >

>> > I create scheduled tasks that start a MS Access project database to do

>> > some

>> > processing. But if it's not complete by the next start time, it needs

>> > to

>> > skip

>> > that scheduled start. I can't do this in VBA code because since it's a

>> > project/adp database you get the "database will be opened read only"

>> > dialog

>> > box before any of your code runs.

>> >

>>

>> Instead of getting the scheduled task to open the data base directly,

>> get it to run the following batch file:

>>

>> @echo off

>> tasklist | find /i "msaccess" && goto :eof

>> "c:\program files\...\msaccess.exe" "d:\My Files\Database.mdb"

>>

>>

>>

Guest Jim Brown
Posted

Re: Single instance of Scheduled Task

 

OK, that should work.

Thanks for your help.

 

"Pegasus (MVP)" wrote:

> Same thing:

> @echo off

> tasklist /v | find /i "Database1" && goto :eof

> "c:\program files\...\msaccess.exe" "d:\My Files\Database1.mdb"

>

> Sometimes you have to nose about a bit . . .

>

>

> "Jim Brown" <jb@applicationsplus.com.(donotspam)> wrote in message

> news:7079F699-46FF-4F0A-958F-92362F5AF40C@microsoft.com...

> > OK, I see where your going with that. However there are several databases

> > that get launched this way on the same box. That's only going to indicate

> > that "some" copy of MSACCESS is already running, correct?

> >

> > "Pegasus (MVP)" wrote:

> >

> >>

> >> "Jim Brown" <jb@applicationsplus.com.(donotspam)> wrote in message

> >> news:FD21F97A-1967-442A-AD6E-05E5226F32B0@microsoft.com...

> >> > Is there a way to have a Scheduled Task that does not start if it's

> >> > already

> >> > running?

> >> >

> >> > I create scheduled tasks that start a MS Access project database to do

> >> > some

> >> > processing. But if it's not complete by the next start time, it needs

> >> > to

> >> > skip

> >> > that scheduled start. I can't do this in VBA code because since it's a

> >> > project/adp database you get the "database will be opened read only"

> >> > dialog

> >> > box before any of your code runs.

> >> >

> >>

> >> Instead of getting the scheduled task to open the data base directly,

> >> get it to run the following batch file:

> >>

> >> @echo off

> >> tasklist | find /i "msaccess" && goto :eof

> >> "c:\program files\...\msaccess.exe" "d:\My Files\Database.mdb"

> >>

> >>

> >>

>

>

>


×
×
  • Create New...