Pietka Posted January 20, 2006 Posted January 20, 2006 Hi all ! Need help once more I'm a total lame and feel shame but have no clue how to solve it. Have script which uses xcopy and progress bar from my guru ezzetabi : ; Script Start - Add your code below here $src="c:\intel" _xcopyWithDialog($src, "c:\temp") Func _xcopyWithDialog($sStartingDir, $sDestDir, $sSettings = '/i/c/e/d/h/r/y') Local $iPid, $iSDSize, $iODSize If FileExists($sStartingDir) And StringInStr(FileGetAttrib($sStartingDir), 'd') Then $iPid = Run(@comspec & ' /c xcopy "' & $sStartingDir & '" "' & $sDestDir & '" ' & $sSettings) $iSDSize = DirGetSize($sStartingDir) ProgressOn ( "XCopy", "Coping temp please wait...") While ProcessExists($iPid) $iODSize = DirGetSize($sDestDir) ProgressSet(Round(100 * $iODSize / $iSDSize) ) Sleep(100) WEnd ProgressOff( ) Else Return -1 EndIf EndFunc ; And want to hide dos window with xcopy @swhide doesn't work - or I do not know how to make it correctly. I have added to line with run command comma separated as a flag ( so it looked like this : $iPid = Run(@comspec & ' /c xcopy "' & $sStartingDir & '" "' & $sDestDir & '" ' & $sSettings ,@swhide) but script shows erros Can anyone help me ? Thanks Pietka
Valuater Posted January 20, 2006 Posted January 20, 2006 i cant test it... but change this @swhide to this @SW_HIDE 8)
MHz Posted January 20, 2006 Posted January 20, 2006 $iPid = Run(@comspec & ' /c xcopy "' & $sStartingDir & '" "' & $sDestDir & '" ' & $sSettings , '', @SW_HIDE) Also the working dir parameter is needed.
Pietka Posted January 20, 2006 Author Posted January 20, 2006 Ok - I made mistake here on the forum - of course I typed in @sw_hide .... but it doesn't work - says unable to execute the external program ... Mhz - directory is not needed - beacuase it is in the code ...
Moderators SmOke_N Posted January 20, 2006 Moderators Posted January 20, 2006 MHz is saying you have to have 3 parameters if you are going to use @SW_HIDE .example:Run(Parameter One = @comspec & ' /c xcopy "' & $sStartingDir & '" "' & $sDestDir & '" ' & $sSettings,Parameter Two = '', (you need the quotes at least)Parameter Three = @SW_HIDE)To give you: Run(@comspec & ' /c xcopy "' & $sStartingDir & '" "' & $sDestDir & '" ' & $sSettings , '', @SW_HIDE) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
MHz Posted January 20, 2006 Posted January 20, 2006 (edited) Mhz - directory is not needed - beacuase it is in the code ... Yes, it is indeed. You must use the optional Working Directory parameter in the Run() function if you want to use the flag parameter. You had it missing.Your original command with additions in red:$iPid = Run(@comspec & ' /c xcopy "' & $sStartingDir & '" "' & $sDestDir & '" ' & $sSettings, '' ,@sw_hide)Edit: Thanks SmOke_N, I did not see your post. Edited January 20, 2006 by MHz
Pietka Posted January 20, 2006 Author Posted January 20, 2006 Great it works - sorry Mhz - misunderstanding ... Funniest thing is that I was really close to this solution but missed quotas before comma .... Regards Pietka
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