Jump to content
Sign in to follow this  
DaLiMan

Copy and change name

Recommended Posts

Hi,

I'm trying to make a script which copies a file to a shared folder and rename it.

But copying the file work OK, but renaming is a different story.

Here's what I have:

$message = "VCGgui file installer op S:\"

$var = FileOpenDialog($message, "P:\ProgsToRun\AutoIt\AutoIt-scripts\VCG\Output\", "Executables (*.exe)", 1 )
FileCopy($var, "S:\Daniel\VCG\",1)

Run(@ComSpec & " /c rename " & "S:\Daniel\VCG\"& $var & " SetupVCG.exe", "", @SW_HIDE)

Can someone tell me what I'm doing wrong?

Share this post


Link to post
Share on other sites

Try this, just change your last line alttle.

$message = "VCGgui file installer op S:\"

$var = FileOpenDialog($message, "P:\ProgsToRun\AutoIt\AutoIt-scripts\VCG\Output\", "Executables (*.exe)", 1 )
FileCopy($var, "S:\Daniel\VCG\",1)

Run(@ComSpec & " /c rename S:\Daniel\VCG\" & $var & " SetupVCG.exe", "", @SW_HIDE)

Share this post


Link to post
Share on other sites

Why not just have the FileCopy function rename it?

$message = "VCGgui file installer op S:\"

$var = FileOpenDialog($message, "P:\ProgsToRun\AutoIt\AutoIt-scripts\VCG\Output\", "Executables (*.exe)", 1 )
FileCopy($var, "S:\Daniel\VCG\SetupVCG.exe",1)

I am pretty sure that should work. Hope this helps!

*** Matt @ MPCS

Share this post


Link to post
Share on other sites

Why not just have the FileCopy function rename it?

I am pretty sure that should work. Hope this helps!

*** Matt @ MPCS

<{POST_SNAPBACK}>

Yep,

Thanks Matt. :)

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.

×
×
  • Create New...