Output to a file

(imported topic written by Sharonbi691)

Hi,

I’m trying to run an installation with a flag,

but for some reason it ignores the flag…

  1. this one doesn’t work at all:

waithidden c:\filename.exe -oid 1.2.840.113741.1.54 > c:\filename.txt

waithidden “c:\filename.exe -oid 1.2.840.113741.1.54 > c:\filename.txt”

  1. this one ignores the flag:

waithidden cmd.exe /C c:\filename.exe -oid 1.2.840.113741.1.54 > c:\filename.txt

waithidden cmd.exe /C “c:\filename.exe -oid 1.2.840.113741.1.54 > c:\filename.txt”

  1. created a batch file which runs the same command.

when running it locally it works, when running it from the fixlet, it does nothing…

waithidden filename.bat

waithidden cmd.exe /C filename.bat

I also tried adding the runascurrentuser.exe script to all of the above commands, but the results are pretty much the same…

any ideas?

(imported comment written by BenKus)

Hey Sharonbi,

How about this:

waithidden cmd.exe /C “c:\filename.exe” -oid 1.2.840.113741.1.54 > “c:\filename.txt”

The name of the exe should be enclosed in double quotes (especially if it has a space in it) and also the filename at the end should be enclosed in double-quotes.

Ben

(imported comment written by Sharonbi691)

didn’t work.

It didn’t even create the output file that way…

(imported comment written by Sharonbi691)

OK, I found the problem.

It is indeed permission problem.

the cmd that opens is opened with the “system” user

however when i add Runascurrentuser to the command in the following formats,

it gives me empty output…

waithidden RunAsCurrentUser.exe cmd.exe /C “c:\filename.exe -oid 1.2.840.113741.1.54 > c:\filename.txt”

waithidden cmd.exe /C RunAsCurrentUser.exe “c:\filename.exe -oid 1.2.840.113741.1.54 > c:\filename.txt”

tried running it locally with RunAsCurrentUser.exe and also i got nothing…

in general I narrowed it down to simpler commands.

If you can help me make it work for them, I guess it will be good for the original commands too.

cmd.exe /K ipconfig /all>c:\x.txt - works fine (locally)

however,

c:\RunAsCurrentUser.exe cmd.exe /K ipconfig /all>c:\x.txt - don’t work…

(also with “…”)

(imported comment written by Sharonbi691)

After many trials & errors, I found how to do it:

Apparently it takes 2 cmd’s to bypass that problem:

waithidden “{pathname of client folder of site “SecurityProd” & “\RunAsCurrentUser.exe”}” --w cmd.exe /C cmd.exe /C “c:\XX.exe -oid 1.2.840.113741.1.54 > c:\x.txt”

Thanks!