Jump to content

New to this...


advance
 Share

Recommended Posts

I was working on a simple script to sync two directores with each other, this is what I had:

$destination = InputBox("Where would you like to move the files to be 
copied to [what is the destiniation]?", "Destination.", "",)
$source = InputBox("What is the source to be moved to destination", "Source.", "",)
DirCreate ( $destination )
DirCopy ( "$source", "$destination" )

But when I run it, I get a folder called $destination on my desktop with nothing in it. What am I doing wrong?

Thanks in advance,

Matt

Link to comment
Share on other sites

This is working for me:

$dest = FileSelectFolder("Choose a destination Folder.", "")
$dest1 = InputBox("Create Folder", "Enter folder name", "", "")
$dest2 = ($dest & "\" & $dest1)

$source = FileSelectFolder("Choose a source Folder.", "")

DirCreate ( $dest2 )
FileCopy($source & "\*.*", $dest2 & "\*.*")

Were ever i lay my script is my home...

Link to comment
Share on other sites

I was working on a simple script to sync two directores with each other, this is what I had:

$destination = InputBox("Where would you like to move the files to be 
copied to [what is the destiniation]?", "Destination.", "",)
$source = InputBox("What is the source to be moved to destination", "Source.", "",)
DirCreate ( $destination )
DirCopy ( "$source", "$destination" )

But when I run it, I get a folder called $destination on my desktop with nothing in it.  What am I doing wrong?

Thanks in advance,

Matt

<{POST_SNAPBACK}>

Matt, you have your $source and $destination varibles in "". You shouldn't put variables in "". Hope that helps.

Ian

"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Link to comment
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
 Share

  • Recently Browsing   0 members

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