Sign in to follow this  
Followers 0

How To Create & Share A Remote Folder

2 posts in this topic


Quick question about AutoIt V3's ability to perform functions on remote computers/servers. In the past I have used the following DOS batch file to create and then share new folders on a list of servers ( the example includes only 2 fictional servers). The DOS batch file relies on a 3rd party program provided by Microsoft called RMTShare.exe. My question is whether AutoIt v3 can perform this same function without the use of RMTShare.exe (via built in functionality) or if needed, how would AutoIt implement RMTShare.exe. Here is the DOS Snippet:

SET STRNAME="Store Location 1"
SET STRNAME="Store Location 2"

If Exist R: Net Use R: /Del
Net Use R: \\%SERVNAME%\E$
REM The following line creates the "AdUsers" folder on the servers E$ share
MD AdUsers
REM The following line calls the RMTShare command line tool to share the folder
REM created above.
RMTSHARE.exe \\%SERVNAME%\AdUsers="E:\AdUsers" /Remark:"Active Directory Project"

I understand the use of the Func command in AutoIt, just not sure about the actual commands or syntax necessary for AutoIt to connect to the E$ share of a remote server, create a folder if necessary and then share it. Also, I find myself often using the Net Use command to connect to and perform functions on remote servers (i.e. verify existence of files, etc.). Just wondering if there is a better way to do it AutoIt that is 'pure AutoIt'.

As always, thanks in advance for any suggestions


Share this post

Link to post
Share on other sites

#2 ·  Posted (edited)

@ZK: I think such a function is not implemented in Autoit3 but I use the rmtshare-tool too.

Your lines could look like:

Global $rmtshare = @ScriptDir & "\rmtshare.exe"; only a sample
Runwait(@ComSpec & " /c " & $rmtshare & " \\" & $servname & "\AdUsers=""E:\AdUsers"" /Remark:""Active Directory Project""

But you could write it a little more flexible with more variables you know.


Edited by kotschi

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
Sign in to follow this  
Followers 0