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

  • SEARCH
  • Home
  • 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 6054277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:08:06+00:00 2026-05-23T08:08:06+00:00

In a standard windows batch file (.cmd) I want to do: FOR /F skip=0

  • 0

In a standard windows batch file (.cmd) I want to do:

FOR /F "skip=0" %%G IN (filename.txt) DO ( ECHO %%G )

but I get " was unexpected at this time.

"skip=1" works fine (In my actual code 0 is a variable).

According to ss64.com the default is skip=0, but it seems not to work when explicitly set.

Am I doing it wrong? Or is there a workaround I can use?

Edit:

I have tried this on both Windows server 2003 and Windows 7.

The content of filename.txt could be:

something
stuff
unicorns
  • 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-05-23T08:08:07+00:00Added an answer on May 23, 2026 at 8:08 am

    It really doesn’t like the 0, causing the parser to expect more after it (You can also trip it when trying to use 09 which it tries parsing as octal, which fails).

    I guess you need to create an environment variable holding the entire skip=n part or nothing and insert that into the argument list. Something like

    if %N% GTR 0 (
      set SKIP="skip=%N%"
    ) else (
      set SKIP=
    )
    

    and then use

    for /f %SKIP% %%G ...
    

    (or without the quotes if you need to pass more options).

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

Sidebar

Related Questions

I am trying to call a batch file from an application, but I want
In a standard windows .cmd file I can send messages to stdout simply by
I have the VS2005 standard edition and MS says this: Note: The Windows Service
So, I think I may be going insane. This batch script: @Echo on dir
As the title suggests, I just want to display a standard windows error icon
How do I pipe standard error to a file in a DOS batch file?
I have created a simple application icon by embedding a standard windows resource file
Say I've got a windows batch file with a file extension .batscript , and
I just want to know, can we replace standard windows login UI with Win
Is there a way to get a standard Windows Forms application to detect if

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.