DaLiMan Posted September 30, 2004 Share Posted September 30, 2004 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? Link to comment Share on other sites More sharing options...
MHz Posted September 30, 2004 Share Posted September 30, 2004 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) Link to comment Share on other sites More sharing options...
Matt @ MPCS Posted September 30, 2004 Share Posted September 30, 2004 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 Link to comment Share on other sites More sharing options...
DaLiMan Posted September 30, 2004 Author Share Posted September 30, 2004 Try this, just change your last line alttle.No,Won't work... Link to comment Share on other sites More sharing options...
DaLiMan Posted September 30, 2004 Author Share Posted September 30, 2004 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now