Jump to content

Recommended Posts

Posted

Group,

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 SERVNAME=Server01
CALL :SUB1
SET STRNAME="Store Location 2"
SET SERVNAME=Server02
CALL :SUB1

GOTO EOF:
:SUB1
If Exist R: Net Use R: /Del
Net Use R: \\%SERVNAME%\E$
R:
REM The following line creates the "AdUsers" folder on the servers E$ share
MD AdUsers
N:
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"
:EOF

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

ZK

Guest kotschi
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""
","",@SW_HIDE)
...

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

Holger

Edited by kotschi

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...