This is the script I am trying to execute:
(netsh wlan show profiles) | Select-String "\:(.+)$" | % {$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name="$name" key=clear)} | Select-String "Key Content\W+\:(.+)$" | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Format-Table -AutoSize
Which is stored in a file "NetGrabber.ps1" and I want to execute it in C++, I would like to use the file but I can hard code it too if that's easier. And my code I have so far, I just want it to be run in a case statement just like
Case 1:
Execute();
break;
WinExec is for exe and batch files as far as I'm concerned.