1.

Solve : Converting Batch script to powershell?

Answer»

Hi Guys,

I am not sure if i can post this here so please let me know; I want to try and convert this batch script into a powershell one, anyone here with experience in ISE? I am not experienced with it but i am trying to learn...

If you have questions of what the script does please let me know,

Thank you



Code: [Select]for /f %%F in (IP.txt) do (

psexec.exe \\%%F -u administrator -p PassWord msg.exe * /time:30  UPDATE - App will close in 30 seconds for NEW updates to be installed. Please stand by
timeout 30

psexec.exe \\%%F -u administrator -p PassWord  msg.exe * /time:58 now updating - Please DO NOT use the computer.
timeout 3

pskill.exe "AppProcess" \\%%F -u administrator -p PassWord
timeout 5

psexec.exe -u administrator -p PassWord  \\%%F xcopy "\\%MYIP%\Share\folder1" "\\%%F\C$\Program Files (X86)\folder1" /E /C /H /R /K /Y
timeout 5

psexec.exe \\%%F -u administrator -p PassWord  msg.exe * UPDATED! If you experience any issues please call . Thank you
)

Why is the batch file a problem? Whats the goal in having it all in powershell without the batch mechanism that calls to powershell?

Is this batch your exact batch or something copy/pasted from elsewhere as an example?

I look at this and see no problems with its use other than that the user/password is out in the open wherever this batch resides, but if on 1 computer under your control then not a problem as powershell within the batch passes authentication over network to remote systems as listed in your IP.TXT list.OBVIOUSLY those are not the real passwords......
I need to convert this to Powershell for a reason that is not your concern (:
If you cant do it then please move along.


Thanks
WOW NASTY .... Well obviously you have plans to do something illegal or malicious then cause nice people generally dont ask for illegal advice with attitude. Move along little one. 

Hiding the reason = your up to no GOOD  lol how is that illegal , all the script is doing is copying stuff between computers in one network.

I have replaced all the INFO thats sensitive info and you are commenting some ignorant *censored*. If you are not here to help then why are you even wasting your time commenting?? are you that much of a salty person? By the way if you are going to accuse someone of doing something illegal then have some proof.  edited by AllanI've edited your post. No more personal attacks please.Then make sure people don't come and post stuff like that. i'm asking for help if you don't want to then move along. no need to comment.okay, thanks for stopping by. Lot's of other sites will no doubt welcome you.



Discussion

No Comment Found