How to create a Direct Access to an FTP address with a bat file (or VB.NET code)?

0

What I want to do is a direct access to an FTP site, for users to run the .Bat and automatically create Direct Access on their desktops and open the FTP site with Windows Explorer.

I hope you can help me.

Edit: I can also use a code in VB.NET

    
asked by Rchrd 03.02.2018 в 00:28
source

1 answer

0

You can do the following:

$WsShell = New-Object -comObject WScript.Shell
$Shortcut = $WsShell.CreateShortcut("$HOME\Desktop\FTP.lnk")
$Shortcut.TargetPath = "ftp://usuario:password@servidor"
$Shortcut.Save()
  • Using the WScript.Shell object, we can create the shortcut.
  • The variable $ HOME was used, which indicates the user's profile when executing the script (therefore, the Desktop folder has been added to save the access there) .
  • Simply using the following structure you can define the connection to the ftp server:
  

ftp: // 'user': 'password' @ 'server'

    
answered by 04.02.2018 / 03:55
source