Results 1 to 9 of 9

Thread: process.start

  1. #1

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    process.start

    Hello,

    I have the following line of code that simply starts explorer with some folder

    System.Diagnostics.Process.Start("explorer.exe", HPGDellClientCore.Settings.LocationsSettings.Default.UnProcessedOrderFilesFolder);

    This works fine on most computers.
    However, i recently installed the application on a Windows 7 computer and I get Access Is Denied exception when running this line.

    Any Ideas?

    Thanks,
    Don't anthropomorphize computers -- they hate it

  2. #2
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: process.start

    Well considering that HPGDellClientCore object/namespace is not part of the .NET framework as standard, I think you better tell us where this UnProcessedOrdersFilesFolder directory actually is... If you are getting access denied messages then it must be in a location that you do not have Read permissions for. Using Process.Start on Windows 7 to launch explorer and make it open a 'protected' location like C:\Windows still works fine, so I'm guessing the permissions on this folder you are trying to open are not set correctly.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  3. #3

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Re: process.start

    hehe, my bad.
    It always returns a string which is a location on the hard drive.
    Don't anthropomorphize computers -- they hate it

  4. #4
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: process.start

    Yes I know that lol (well I guessed that) - I meant what location on the hard drive is it referring to
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  5. #5

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Re: process.start

    local folder. c:\somefolder

    The folder is also shared out.
    Don't anthropomorphize computers -- they hate it

  6. #6
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: process.start

    Is it actually directly in the root of the C drive then or are you just using that as an example? Are you trying to access it via a local path then (e.g C:\) or via the UNC path using the share name (e.g \\PCName\ShareName)?
    Check the permissions on the folder by right clicking on it and going to Properties, then click the Security tab and have a look at each of the accounts listed in there and make sure the relevant ones have Read permission (at least). It might also be worth checking the share permissions, though if you are accessing it via a local path (C:\) then they should not be affecting anything. Anyway you can check them by clicking the Sharing tab in that same properties window, then clicking the Advanced Sharing button, then clicking the Permissions button.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  7. #7

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Re: process.start

    Ok, this is weird.
    I am running the app locally on the workstation and am getting "Access is Denied" when trying to run that line.
    The folder it is trying to open is a local folder. I am logged in as the admin.

    Wow.
    Don't anthropomorphize computers -- they hate it

  8. #8
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: process.start

    See previous post about checking permissions..
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  9. #9

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Re: process.start

    the settings are set.
    when i log in, i can navigate and modify the folder any way i wish.
    When i run the .net application, however, i get access is denied when trying to open it in explorer.
    Don't anthropomorphize computers -- they hate it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width