Sign in to follow this  
Followers 0
Pietka

Ezzetabi script - need help once more ...

7 posts in this topic

Hi all !

Need help once more :lmao: 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

Share this post


Link to post
Share on other sites



i cant test it...

but change this

@swhide

to this

@SW_HIDE

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

$iPid = Run(@comspec & ' /c xcopy "' & $sStartingDir & '" "' & $sDestDir & '" ' & $sSettings , '', @SW_HIDE)

Also the working dir parameter is needed. :lmao:

Share this post


Link to post
Share on other sites

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 ... :lmao:

Mhz - directory is not needed - beacuase it is in the code ... ;)

Share this post


Link to post
Share on other sites

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)


[center]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.[/center]

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Mhz - directory is not needed - beacuase it is in the code ... :lmao:

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 by MHz

Share this post


Link to post
Share on other sites

Great it works - sorry Mhz - misunderstanding ...

Funniest thing is that I was really close to this solution but missed quotas before comma ....

Regards

Pietka

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  
Followers 0