2019: Command Line and Scripting with WebDrive for Windows

2019: Command Line and Scripting with WebDrive for Windows

You can connect WebDrive to your server using the command line and also using scripts. These examples assume that WebDrive was installed into the default directory of C:/Program Files/WebDrive. Here are some examples:


1. Connecting to a site that is predefined in WebDrive: 


"C:\Program Files\WebDrive\WebDrive.exe" /s:"MySite"


The /s switch provides the name of the site profile that has already been created and configured in the WebDrive UI.

In this case, it is not necessary to specific the username, password, protocol to be used, URL, or drive letter, because these are all configured in the site profile that has already been created in WebDrive.


2. Creating a connection and then connecting that site using WebDrive: 


"C:\Program Files\WebDrive\WebDrive.exe" /s:"MySite" /pr:1 /url:"https://example.url.com/MySiteFiles" /u:testuser /p:testpassword /d:Z


The /s switch provides the site profile with a name. This is required for WebDrive.

The /pr switch selects the protocol to be used. 1 selects WebDAV. This is required when the site is not predefined in the WebDrive UI.

The /u switch allows entering the username for the connection.

The /p switch allows entering the password associated with the username.

The /d switch assigns the connections to a specific drive letter. This is required for WebDrive.


The full list of switches and options for each switch can be found in the Help File: Command Line Parameters


3. If the server you are connecting to supports Active Directory Authentication (usually IIS Servers), you can utilize AD credentials by omitting the username and password switches, or by entering empty strings ("") for each.


4. Connecting, copying files, and then disconnecting a drive. For this example, the drive is mapped to X: 


start /wait /D"C:\Program Files\WebDrive" WebDrive.exe /s:"MySite" 

copy x:\example.txt c:\ 

start /wait /D"C:\Program Files\WebDrive" WebDrive.exe X: /d


Using the start /wait command and switch allows for proper timing to ensure that different operations work properly. /D means that the path is coming next.

The /s switch provides the name of the site profile that has already been created and configured in the WebDrive UI. 

The copy command is used to copy the example.txt file from its location at the root of X: to the root of C:

Again, the start /wait /D sequence is issued before calling WebDrive.exe again. 

The X: selects the X drive (the WebDrive mapped drive in this example) and the /d switch disconnects the mapping.



    • Related Articles

    • 2019: How can I uninstall WebDrive via command line ?

      Typically you uninstall WebDrive from the add/remove programs in Windows, however if you want to use a command line or automate this procedure use the following command msiexec /x {F08E87FD-F62B-4BAC-A2D6-A94755653F30} /QN REBOOT=R
    • Command Line - Check if Site is Connected. If it is not, Connect it

      Below and also attached is text for use to check if a drive letter is mapped using WebDrive. If the drive letter is not mapped, WebDrive will then attempt to connect the site. This may be useful if the drive letter seems to disconnect at times, or ...
    • What are the system requirements for WebDrive?

      Windows Mac WebDrive is supported on the 64-bit editions of Windows. Windows 11 Windows 10 Windows 8 Windows Server 2019 Windows Server 2016 R2 editions Windows Server 2016, all editions Windows Server 2012-R2 editions Windows Server 2012, all ...
    • I receive an error that Windows can't access this disc. What do I do?

      Error: Windows can't access this disc. Meaning: Windows is unable to connect and display the contents of the drive letter Resolution: 1. Restart the computer and attempt the connection again. If the issue remains, try either Resolution 2 or 3: 2. ...
    • 2019: Moving or Changing a WebDrive License to a New or Different Computer

      How can I move WebDrive to a new machine? Use the Export feature in WebDrive to export your Site Database and User Settings out to a .reg file. Run WebDrive, then from the main menu, select FILE -> EXPORT and export your data out to a file. Copy that ...