Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows API
  4. Running a bat file in Windows PE 2.0 [modified] [Solved]

Running a bat file in Windows PE 2.0 [modified] [Solved]

Scheduled Pinned Locked Moved Windows API
helpcomtestingbeta-testingjson
1 Posts 1 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dybs
    wrote on last edited by
    #1

    I have a bat file with the following FOR loop for parsing the output of a command:

    FOR /F "tokens=3 delims=," %%I IN ('command that gets info') DO (
    process the results
    )

    This works fine in XP and Vista, but when I run it in a Windows PE 2.0 environment, I get the error

    ( was unexpected at this time

    The command in "command that gets info" has no () in it, so this must be from the ( in the FOR loop syntax. Does Windows PE seriously not support () for block-level command, even though Vista does? [EDIT] After some more testing, it looks like there was some sort of whitespace issue, plus I guess I forgot to install the WMI package - oops :) Anyway, I found a different solution using VBScript that I used here[^]. [/EDIT] Dybs

    The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups