Raja Ram
Raja Ram

Reputation: 109

Not able to execute batch script

Below is the script which I am trying to execute but after double clicking on the batch file it opens command window and immediately command prompt will be disappeared.

CD /D C:\RAJA_WORKSPACE\NTLePrismAutomation\NTLePrismAutomation\ePrismReports\

for /f "eol=: delims=" %F in ('dir /b /od *.html') do @set "newest=%F"

"%newest%"

Upvotes: 1

Views: 22

Answers (1)

npocmaka
npocmaka

Reputation: 57252

CD /D C:\RAJA_WORKSPACE\NTLePrismAutomation\NTLePrismAutomation\ePrismReports\

for /f "eol=: delims=" %%F in ('dir /b /od *.html') do @set "newest=%%F"

"%newest%"

though I don't think you need the eol option. Batch files require double % for for tokens while in the command prompt they must be single.

Upvotes: 2

Related Questions