![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| x64 | Powershell Newbie Hi, I'm now to this forum, hi to everyone. I normally use command prompt and have now decided to use powershell. I have the following script:- Set-Location "C:\Documents and Settings\Admin\Desktop\TEST" $yesterday=(get-date (get-date).AddDays(-1) -uformat %Y%m%d) rename-item 20090408_04.LOG "$yesterday.a04" Fisrtly, I cannot get the script to run, I've set the file *.ps1 to open with powershell, I get a flash of red writing and it disappears too quickly. Therefore I have no idea what the error is. The Execution Policy is set to unrestricted. Secondly, the files I'm trying to rename change on a daily basis (today's date)_04.LOG, (today's date)_05.LOG, (today's date)_06.LOG etc to $yesterday.a04, $yesterday.a05, $yesterday.a06 etc. How would I do this??? I know, this is my first time, I'm asking loads of questions.... Thanks in advance. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| powershell newbie help | PowerShell | |||
| Newbie: WMI and Powershell | PowerShell | |||
| Newbie to Powershell | PowerShell | |||
| Newbie to PowerShell | PowerShell | |||
| newbie - How to use FTP in powershell | PowerShell | |||