#1 30 Oct 2012 11:46

npocmaka
Member
From: Bulgaria
Registered: 03 Dec 2009
Posts: 422

batch files and date -uformat

Just noticed that if you call get-date with -uforrmat via bat file and command prompt differs a little bit  - calling from bat file requires a double percent sign:

e.g.:
this will work from command prompt:
powershell get-Date -uformat %D

but to work in batch file it needs to be:
powershell get-Date -uformat %%D

(which I suppose is logical if the batch syntax is taken into account)

Offline

#2 03 Nov 2012 13:43

Simon Sheppard
Super Administrator
Registered: 27 Aug 2005
Posts: 899
Website

Re: batch files and date -uformat

Good point, I've added a note on the PS Powershell.exe page about this.
http://ss64.com/ps/powershell.html

Offline

Board footer

Powered by FluxBB