Waithidden not working properly?

(imported topic written by hernan91)

Hi.

Im using a bat file in order to copy information from a share drive, the copy works without issues, but i noticed that the waithidden is not working, every time that i run the action it opens 3 dos windows, it’s not waiting to complete one copy and then move to the other instruction.

Thanks.

delete __appendfile

appendfile @echo off

appendfile NET USE f: /DELETE /persistent:yes

appendfile NET USE f: {parameter “a”}\D$ {parameter “p”} /USER:{parameter “a”{parameter “b”}

appendfile f:

copy __appendfile __download\bat.bat

waithidden __Download\RunAsCurrentUser.exe --w cmd /C __download\bat.bat

waithidden __Download\RunAsCurrentUser.exe --w cmd /C start /wait “” /min /b robocopy Source Dest

waithidden __Download\RunAsCurrentUser.exe --w cmd /C start /wait “” /min /b robocopy Source Dest

waithidden __Download\RunAsCurrentUser.exe --w cmd /C start /wait “” /min /b robocopy Source Dest

(imported comment written by SystemAdmin)

You’re missing the --q option for RunAsCurrentUser.

waithidden is hiding the app it’s running (RunAsCurrentUser)

–q is telling RunAsCurrentuser to hide the app it’s launching (CMD)

-Paul

waithidden __Download\RunAsCurrentUser.exe --w --q cmd /C __download\bat.bat
waithidden __Download\RunAsCurrentUser.exe --w --q cmd /C start /wait “” /min /b robocopy Source Dest
waithidden __Download\RunAsCurrentUser.exe --w --q cmd /C start /wait “” /min /b robocopy Source Dest
waithidden __Download\RunAsCurrentUser.exe --w --q cmd /C start /wait “” /min /b robocopy Source Dest

(imported comment written by hernan91)

Thanks Paul.

Actually I was using an old version of the RunAsCurrentUser, now i’m using the version 2.0.3.1 and now it works as you mention.

Thanks.

(imported comment written by SystemAdmin)

Yeah, I don’t think --q worked for the original one (v1.1.0.0).

Glas to hear it worked.

-Paul

(imported comment written by hernan91)

Hi.

After the changes the action script works without issues, i’m using an schedule activity in order to run the task every day, but i notice that for some computers the action never ends it has a message of “Running” and if i look into the action this is what i see.

Completed copy __appendfile __download\map.bat

Running waithidden __Download\RunAsCurrentUser-2.0.3.1.exe --w --q cmd.exe /C __download\map.bat

waithidden __Download\RunAsCurrentUser-2.0.3.1.exe --w --q cmd.exe /C robocopy

if i go into the computer and kill the cmd.exe, the action continues. This action should take seconds to complete the process, do i need to check and kill the cmd.exe process before de execution?

Thanks.

(imported comment written by SystemAdmin)

Hernan,

To debug it…

Why don’t you try using a “wait” rather than “waithidden”, and remove the --q. Then you can see what’s going on when you deploy it to a PC.

It might also help to change “cmd.exe /C” to “cmd.exe /K” so it gives you a chance to read it without it exiting automatically. /K tells CMD to stay open after the command finishes.

-Paul

(imported comment written by hernan91)

Thanks Paul

I will try that.