Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

a vb script maybe


Recommended Posts

There's a script SaveBackup-Mick.zip on the ftp server under vb_scripts directory that will do that.

 

Do a search on the forum there are several scripts floating around. I believe Rekd did one that backed up to RAR files and James did one to Zip files.

 

Bryan smile.gif

Link to comment
Share on other sites

Save a file in two locations at the same time can easily be done, and can be done many ways. In its most simplest form, this can accomplish what you need with very few lines of code:

 

code:

'////////////////////////////////////////////////////////////////////////////////

'//

'// Author: Chris Bellini [email protected]

'// Date: 03/07/2005 9:18 PM

'// File Name: SaveTwice.vbs

'//

'// Description: save a file to two different locations

'//

'// Comments: Modify DEF_LOCAL_PATH and DEF_NETWORK_PATH to suit your needs

'////////////////////////////////////////////////////////////////////////////////

 

' don't forget the trailing ""

Const DEF_LOCAL_DIR = "C:YourDir"

Const DEF_NETWORK_DIR = "M:MappedPath"

 

' Call the main subroutine

Call Main()

 

 

' Purpose: The main subroutine

Sub Main()

Dim strLocalPath ' path to local file

Dim strNetworkPath ' path to file on mapped drive

Dim strFname ' filename

 

' prompt for filename

strFname = AskString("T (no need to enter the MC9 extension)")

 

' exit the script if it's an empty string

If (strFname = vbNullString) Then

Exit Sub

End If

 

' assemble the paths

strLocalPath = DEF_LOCAL_DIR & strFname & ".MC9"

strNetworkPath = DEF_NETWORK_DIR & strFname & ".MC9"

 

' save the file twice

Call SaveMCAs(strLocalPath, True)

Call SaveMCAs(strNetworkPath, True)

End Sub

Of course, this is a simple example but it's very easy to expand upon this with directory selection dialogs and so on. There's also the backup scripts on the forum and FTP server that Bryan mentioned.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...