On Tue 2009-04-28 18:30:33 UTC-0400, John Gaughan ([email protected]) wrote:
> > system("cmd /C \"C:\\Program Files\\Wireshark\\tshark.exe\" -r
> > C:\\input\\tcpdump.cap -R \"tcp.dstport==7275 && ulp.msSUPLPOS\" -V >
> > C:\\output\\dump.txt");
>
> Nitpick: one should use the SHGetFolderPath function to retrieve the
> program files directory instead:
>
> http://msdn.microsoft.com/en-us/library/bb762181(VS.85).aspx
>
> Otherwise, the system call above will fail for people who have relocated
> their program files.
getenv("ProgramFiles");
This might be an easier way, especially if you want to avoid calling
the Windows API.
Maybe not usable in early (pre-XP?) versions of Windows though.