Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Make network connection from scheduled task
Message
 
À
05/11/2004 17:29:45
Guy Pardoe
Pardoe Development Corporation
Peterborough, New Hampshire, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00958713
Message ID:
00958722
Vues:
21
>HI,
>
>I need to have a small VFP utility that gets fired from a scheduled task. This utility needs to connect to a network drive and copy some files from the network share down to the local PC and then do some other misc processing.
>
>My problem is that there will be no user looged in when the schedule task launches. I thought it'd be no problem because when I define the scheduled task, I can also set the user whose privileges will apply when the task is run.
>
>I've searched messages on this board for WNetAddConnection, etc, but so far I can't find anything that works unless there is already a logged in user.
>
>Does anyone have any sample code of mapping a network drive that works with no user logged in but rather, launched with admin (or any other user) privileges from a scheduled task?
>
>Thanks,
>Guy

Can't you just copy using the UNC? (and use UNC where elsewhere needed)

copy file \\Server\path\file to C:\path\file


Additionally, you probably should create a log-on session, take a look at Message #948574 to use impersonation
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform