Jump to content
Sign in to follow this  
JonF

Copying files over a VPN

Recommended Posts

I have a server running Small Busines Server 2008.  On that server is a shared directory containing Microsoft Office templates in the normal directory setup; a bunch of templates, a Smart Art subdirectory, and a Document Themes subdirectory containing Theme Colors, Theme Effects, and Theme Fonts subdirectories.

My task is to create a program that copies all that to the local user's templates subdirectory.  It must work on the local network or over the VPN.  I am not allowed to wipe the local template directory. I may not assume that any drives are mapped, I have to use UNC paths to the server. So a .cmd file doesn't work because it doesn't do UNC paths, at least copy and xcopy and robocopy don't.

This morning I sat down with AutoIt and came up with:

 

#include <File.au3>
#include <Array.au3>
#include <FileConstants.au3>

$LocalPath = EnvGet("APPDATA") & "\Microsoft\Templates\"
$Result = DirCopy("\\192.168.7.250\Users\<redacted>\<redacted>\<redacted>\<redacted> Templates 2",$LocalPath,$FC_OVERWRITE)
MsgBox(0,"Info",$Result)

Works on the internal network. Works when I connect to our guest network (which is a different subnet) and connect to the (SoftEther) VPN.  Does not work when connected to the VPN on physically remote machines.

?????

 

Share this post


Link to post
Share on other sites

Guess you arent allowing something via vpn. Are all mickysoft required ports open and can you browse the fileshare with the explorer when connected via vpn?

jos

 

 


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By AlMax3000
      You can make a program or solution that copies all files of a certain extension, example  > .rar (only rar),  and copies them to a directory
       
       
      too simple I solved 🙂


    • By AnonymousX
      Hello,
      I'm hoping to create a way of copying and renaming a specific file off of a company Sharepoint site.
      For local files I've always used the method of using FileExists( "path") then FileCopy ( "source", "dest" [, flag = 0] )
      #include <WinAPIFiles.au3> Copy_File() Func Copy_File() local $source = "C:\Users\auser\Documents\test.xls" Local $dest = "C:\Users\auser\Documents\test" Local $iFileExists = FileExists($source) If $iFileExists Then FileCopy($source,$dest);copy file to new location MsgBox($MB_SYSTEMMODAL, "", "File was copied") Else MsgBox($MB_SYSTEMMODAL, "", "File doesn't exist") EndIf EndFunc However with the file location provided by sharepoint, it seems autoIt isn't able to find it. File path provided by sharepoint looks something like this:
      https://workspace.company.com/Folder/Folder%20B/File%20Name.xls I know if I have excel open and paste the link into the excel file name open box, it will open the file just fine. Also I know I can create shortcuts to these links, and when I click on them it will open the file just fine too. So I'm not sure how I have to refer to these files for AutoIT to recognize it and copy it to the folder location I want.
      I don't really have a good understanding on how this stuff works, but I was hoping the solution wasn't too complicated, and could use some help.
      Any help is appreciated, thanks in advance.
    • By topten
      With this line of code I can connect my VPN
      Run('rasphone -d "My VPN"') $hWnd = WinWait("[CLASS:#32770]", "Connection to My VPN", 10) $Title = 'Connection to My VPN' $process = WinGetHandle(WinGetTitle($Title)) ControlClick($process, "", "[CLASS:Button; INSTANCE:4]") Is it possible to check, whether VPN has connected or not
    • By adamchapman
      I'm using InetGet to download some files but get an error "13" with InetGet after the 4th download. This occurs while using Hidemyass Pro VPN.
      If I can understand what error 13 actually means I'll have a better chance of debugging
      Does anybody know what error 13 means? I;ve looked at the soucre in the include folder for "IE" and "Inet" but can't see the source for Inetget in either.
      Any help is greatly appreciated
×
×
  • Create New...