Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

creating folder/file in mapped drive

I want to create a subfolder and then a file in folder (P:) which is a mapped folder. (UNC ?) that points to C:\job-files.
With oengine as a service I get a status error on oswrite as the the subfolder did not get created.
If I stop the engine and run the oesocket server the folder & file get created.
I know this has something to do with 'rules' somewhere using mapped drives.
Is there any way of converting the mapped drive to its actual location (c:\job-file)

Comments

  • As you seem to recall, the problem is that Windows services do not share the same user context as your desktop user. This means you do not get mapped drives. Mapping drives on the fly is also challenging and not worth trying to work out. Your solutions should rely upon UNC paths or local drives.

    Since the service account is not aware of a mapped drive in the first place, I don't think it has a way to convert a specific mapped drive to a local or UNC path.
  • Thank you.
    At the local level is there a way to check if a folder location selected is a mapped drive or sub to it, so it can be not allowed.
  • Does the IsNetworkPath service do what you want?
  • Thanks, I will check it out.
  • @donbakke
    >> local or UNC path.

    So you can do oswrite mydata to "\\servername\thispath\myfilename.txt"
Sign In or Register to comment.