Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8951069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:34:40+00:00 2026-06-15T13:34:40+00:00

I need to execute often the following command which compresses all the PNG files

  • 0

I need to execute often the following command which compresses all the PNG files in a folder:

for %i in (*.png) do pngout.exe "%i" /kp

So I have added this command in a file png.cmd and added the folder to the system PATH.

However when I execute the command (png.cmd) from a point in my file system, I get the following error:

C:\Users\Desktop>png  
i" /kp was unexpected at this time.

Is there a way to fix this problem, also I’m thinking where the shell is going to execute the png.cmd command ? In the path where I’ve created the png.cmd file ? I’d need to execute it in the current PATH where I’m with the shell.
Any idea?
Thanks a alot

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:34:41+00:00Added an answer on June 15, 2026 at 1:34 pm

    Your syntax error is caused by using only 1 % in your for loop variable, when you use a batch file you need to use 2 to escape the first one.

    for %%i in (*.png) do pngout.exe "%%i" /kp
    

    With regards to your path question, fix this first, then see if it’s still an issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are often times that I want to execute a command on all files
Attempting to do TDD, I often need to execute all my tests - in
I need to create some windows service which will execute every some often, every
I need to load a web page, execute its JavaScript (and all js files
I need to execute a command 100-200 times, and so far my research indicates
Often I find myself needing to write scripts that have to execute some portions
There is quite often situation when you need to execute INSERT, UPDATE or DELETE
When doing software development, there is often need to include confidential information in command
I have a requirement in which the SSRS 2008 reports need to be run
I have read that, when using react, all actors can execute in a single

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.