coucou Posted December 14, 2006 Share Posted December 14, 2006 Hi,Here bellow a script using FileCopy/FileDelete and @ProgramFilesDir checked working.FileCopy("source_file.exe", @ProgramFilesDir & '\dest_folder\') Run('"' & @ProgramFilesDir & '\dest_folder\source_file.exe"') FileDelete(@ProgramFilesDir & '\dest_folder\source_file.exe')Although, FileCopy and FileDelete functions works, are the script strictly correct?why there are more quotation marks for the Run function???Regardscoucou Link to comment Share on other sites More sharing options...
Glyph Posted December 14, 2006 Share Posted December 14, 2006 This really doesn't have anything to do with your script, but i think "Advise" is spelled " Advice " , just trying to help! tolle indicium Link to comment Share on other sites More sharing options...
coucou Posted December 14, 2006 Author Share Posted December 14, 2006 (edited) This really doesn't have anything to do with your script, but i think "Advise" is spelled " Advice " , just trying to help!Sorry for my poor english.English, is not my mother tongue and i always confuse between an advice and to adviseRegardscoucou Edited December 14, 2006 by coucou Link to comment Share on other sites More sharing options...
Glyph Posted December 14, 2006 Share Posted December 14, 2006 Well, now you know! , ill look into your script 'ill be posting back soon.' tolle indicium Link to comment Share on other sites More sharing options...
Glyph Posted December 14, 2006 Share Posted December 14, 2006 Works fine.. just wondering why do you copy it to the same place its in , run it... then delete it? tolle indicium Link to comment Share on other sites More sharing options...
coucou Posted December 14, 2006 Author Share Posted December 14, 2006 Its a patch applied to a software in an unattenended installation. I'm copying the patch, runing it then delting it. coucou Link to comment Share on other sites More sharing options...
Glyph Posted December 14, 2006 Share Posted December 14, 2006 So, why are you copying it to the same exact directy that it's already in? tolle indicium Link to comment Share on other sites More sharing options...
MHz Posted December 15, 2006 Share Posted December 15, 2006 Here bellow a script using FileCopy/FileDelete and @ProgramFilesDir checked working.FileCopy("source_file.exe", @ProgramFilesDir & '\dest_folder\') Run('"' & @ProgramFilesDir & '\dest_folder\source_file.exe"') FileDelete(@ProgramFilesDir & '\dest_folder\source_file.exe') Although, FileCopy and FileDelete functions works, are the script strictly correct? why there are more quotation marks for the Run function???It would seem that you are trying to delete a running process that is started by Run so the process exits very fast? The extra quotes around the Run parameter is fine as it prevents any spaces causing issue of finding the file. I have yet to notice any need to use extra quotes around any File* functions. Link to comment Share on other sites More sharing options...
xcal Posted December 15, 2006 Share Posted December 15, 2006 This really doesn't have anything to do with your script, but i think "Advise" is spelled " Advice " , just trying to help!Actually, both are correct spelling. Which you use depends on what you're saying."Please advise.""I need advice." How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
JerryD Posted December 15, 2006 Share Posted December 15, 2006 Hi, Here bellow a script using FileCopy/FileDelete and @ProgramFilesDir checked working.FileCopy("source_file.exe", @ProgramFilesDir & '\dest_folder\') Run('"' & @ProgramFilesDir & '\dest_folder\source_file.exe"') FileDelete(@ProgramFilesDir & '\dest_folder\source_file.exe') Although, FileCopy and FileDelete functions works, are the script strictly correct? why there are more quotation marks for the Run function??? Regards coucouSomewhere along the line your original question seems to have gotten lost in the translation (pun intended!). The reason you need double quotes passed for the RUN command is because the string passed is literally run, and if there are any spaces in the path the line will be misinterpreted without the entire path being quoted. Now this might confuse you even more because I learned earlier this year that apparently in some non US versions of Windows @ProgramFilesDir equates to C:\Programs. However, the US version of Windows @ProgramFilesDir equates to C:\Program Files (although it sounds like this may not be your setup) Thus, if the line in your script was Run( @ProgramFilesDir & '\dest_folder\source_file.exe') What would be run is C:\Program with the parameter Files\dest_folder\source_file.exe The FileCopy and FileDelete functions are being passed parameters for which the entire string is used regardless of spaces, so they understand that @ProgramFilesDir & '\dest_folder\source_file.exe' means everything in the string including the spaces. This is also the reason I use single quotes almost exclusively (except if I need a ' within the text) as it makes using double quotes a lot easier. Hope that helps. Link to comment Share on other sites More sharing options...
coucou Posted December 17, 2006 Author Share Posted December 17, 2006 Hi all,Soryy for the delay, I tried replying since Friday but coldn't connect to AutoIt forum.TNX Everybody for yr enlighten...It would seem that you are trying to delete a running process that is started by Run so the process exits very fast? The extra quotes around the Run parameter is fine as it prevents any spaces causing issue of finding the file. I have yet to notice any need to use extra quotes around any File* functions.In fact, these 3 lines will be inserted in Cyberlink MediaShow script. Instead of extracting the MedShow_Patch1 to c:\Program Files\Cyberlink, i'm copying it to. Then i run this patch and when its finish updating MediaShow, i'm deleting it.Regardscoucou 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