Jump to content

[RESOLVED] Unable to create to shared Drive


Recommended Posts

 

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
Link to comment
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.

Link to comment
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

Link to comment
Share on other sites

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.
Link to comment
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
 Share

×
×
  • Create New...