Link to home
Start Free TrialLog in
Avatar of BeGentleWithMe-INeedHelp
BeGentleWithMe-INeedHelpFlag for United States of America

asked on

moving to powershell from dos batch - tutorial / starter advice?

In an other question about stepping through a dos batch file, an expert said

Nowadays you should take the leap to switch to PowerShell.

Got me thinking - I've been making dos batch files since DOS, so I guess I should learn a new skill?

anyone got tips on how to start?  
Is being able to run power shell native to win 7?  XP?  I thought there was something you had to install to get PS to run on a PC? Or maybe just for XP?

What's the extension?

This would empty the windows temp folder, what would it look like as a powershell script?  ANd to run that, you just double click on the file?

Rem Clean windows temp folder
set folder=%windir%\temp
for /f "delims=" %%a in ('dir/ad/b %folder%\*') do (rd /s /q "%folder%\%%a")
del %folder%\*.* /q

 Thanks!
SOLUTION
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial