Quantumation

[RESOLVED] Unable to create to shared Drive

10 posts in this topic

#1 ·  Posted (edited)

 

I can't create a file on a shared drive. I know that directory path is valid. and I've verified i have access to the drive but it keeps returning a Error code: 0

Has anyone else seen this? I assume Dircreate has the ability to modify Shared drive files.

$shared = "\\Idaho-Share"
$Filename = GUICtrlRead($input3)
DirCreate($shared & "\Night Team\" & $Filename)

 

Edited by Quantumation
Issue was resolved

Share this post


Link to post
Share on other sites



Yeah, I pressed enter a little too quickly after the wrong Tab.

I tested it out further and it creates a path in my Documents.

So now i'm doubting that DirCreate can write to Shared folders.

Need to do a little more research. Any input is appreciated.

Share this post


Link to post
Share on other sites

@JohnOne

I don't believe it's supported with DirCreate.

I've tried it with #RequireAdmin and it still doesn't work. I've tried $filename with an extension and one without, it doesn't create either. I Checked _filecreate to see if it builds the path if you set a file to create but it doesn't. The path has to exist first but that only applies to the local computer.

I found _Net_Share_ShareAdd that i think can do what i'm trying to do. I'm testing it right now to see if I can create a folder remotely.

Goal is to create folder on a network share and add a security group with READ only permissions.

The part i'm stuck on is creating the Shared folder.

Share this post


Link to post
Share on other sites

@JohnOne

I tried it with the same error.

Thank you for the suggestion.

i'm going to test the _NeT_Share_ShareAdd and see if that will create folders. I'm trying to better understand what the syntax requirements mean.

Share this post


Link to post
Share on other sites

I figured it out. I needed the root folder for the shared drive. Not the mapped path. The Mapped path only works for Mapping drives because it auto-resolves the preface name.

Instead of using a DFS folder name I found the Root folder:

I was using the "\\Idaho-share\Night Team\TEST" which was the mapped instance but I needed to use: "\\Company.local\files\Site\Night Team\TEST"

That was my error. After i ran it with the local name it created the folder. Thank you for your help @JohnOne

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

That'll only work until your mapped drive to the server becomes inactive.  Also, it must exists.

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • ur
      By ur
      Whenever we try to access a network share it will prompt for credentials based on the shared folder settings.
      Like the below prompt


      Once you save them, they are saved in Windows Credentials of Credentials Manager in Control panel (run --> control keymgr.dll).

       
      But not able to found exact file or registry for this setting.
       
      So, can anyone suggest how to do this process of adding network credentials using AutoIT.