Re: Mapping with CreateProcess

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

From: Ben Rush (kwendex_at_yahoo.com)
Date: 02/01/05


Date: Mon, 31 Jan 2005 23:44:15 -0600

Hello Ed,

What user are you running your task under; what are the permissions? It's
possible the user might not have appropriate priviledges to create the
process.

"Ed McAndrew" <EdMcAndrew@discussions.microsoft.com> wrote in message
news:D9631534-DA22-4454-A92A-0412590B9162@microsoft.com...
> I'm trying to map a network drive share in c# with:
>
> CreateProcess("net", @"use " + LocDrive + " " + Quotes + userShare +
> Quotes
> + " " + userPass + " /USER:" + userName, out exitCode, out output);
>
> Everything is right, and it works perfectly when the compiled executable
> is
> launched manually from a command line.
>
> However; when I attempt to use this console app from a scheduled task, the
> create process event fails. I'm not sure what is going on. There are no
> exceptions being thrown at all. The output is simply null
>
> The purpose of this executable is to run the app as a scheduled task every
> 10 minutes to ensure that a drive mapping is still connected.
>
> I'm not sure how much code or what code of mine you would like to see.
>
> Thanks in advance,
>
> Ed



Relevant Pages

  • DCOM errors while running as domain user - scheduled task
    ... I'm having a bit of a problem getting a VB .NET console app to run happily ... administrator on the server. ... - Running the console app as a scheduled task (with the correct domain user ...
    (microsoft.public.dotnet.general)
  • Re: Scheduled Tasks - Strange Permissions Issue
    ... I did know about this issue and assigned that user the right security permissions on cmd.exe. ... They appear to run and don't issue any errors in the scheduled tasks log, yet they seem to be having permissions problems. ... However, the application that I'm running via the Scheduled Task has its own log which states, "Access is denied". ... Logon Failure: ...
    (microsoft.public.windows.server.security)
  • Re: Add New Users
    ... this is a permissions issue. ... permissions as possible on the AD server. ... >This sample code works perfectly in Console App. ... > Dim grp As DirectoryEntry ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ActiveX Permission Denied Error from Sch Task
    ... Setting permissions in DCom worked. ... The account I was using to launch the ... > Try using dcomcnfg.exe to set the permissions on the ActiveX EXE, ... > it run under a specific account (different to that of the scheduled task) ...
    (microsoft.public.vb.com)
  • Re: Web Service ?
    ... When you run a web service, it inherits the permissions of the ASP.NET account. ... You would need to assign those permissions to the folder and file that you want to access. ... Everything works fine in the console app. ... Request for the permission of type System.Net.WebPermission, System, bla bla bla ... ...
    (microsoft.public.dotnet.general)