Avatar of Swaminathan K
Swaminathan K
Flag for India asked on

filename creation in powershell script

Hi Team,

I am new to power shell , I need to create a log file with the date and timestamp , below is the script used for that purpose , I am getting the error each time i ru n it .Any help is really appreciated

For /F "tokens=2-4 delims=/ " %%a in ('date /t') 
do (set  vardate=%%c%%a%%b)

For /F "tokens=1-2 delims=/:" %%a in ("%TIME%") 
do (set vartime=%%a%%b)

set vartime=%vartime: =0%


set logfile="ETLUPD_%vardate%_%vartime%"

Open in new window

PowershellWindows Batch

Avatar of undefined
Last Comment
Swaminathan K

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
oBdA

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Swaminathan K

ASKER

thanks a lot
Swaminathan K

ASKER
awesome . thanks a lot
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23