Answer the question
In order to leave comments, you need to log in
Why doesn't the PowerShell script run through the batch file?
I created a batch file that runs the following powershell script:
dir C:\Users\home64\Downloads\1a -file | sort -property name -Descending | %{$i=0} {$_.CreationTime = (Get-Date).AddDays($i); $i++}
@echo off
SetLocal EnableExtensions
%SystemRoot%\System32\WindowsPowerShell\v1.0\PowerShell.exe -ExecutionPolicy ByPass -command "dir C:\Users\home64\Downloads\1a -file | sort -property name -Descending | %{$i=0} {$_.CreationTime = (Get-Date).AddDays($i); $i++}"
pause
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question