TechRepublic : A ZDNet Tech Community

Report as spam Question  -  Post 3 of 3
FOR at console and in batch used differently
This error is being caused by the FOR command. Your command is correct when typed at the console, but when using this command in a batch file you need to precede your % variables with a double %. Therefore they would become:

FOR /F "usebackq delims==" %%i IN (`date /t`) DO set date = %%i
FOR /F "usebackq delims==" %%i IN (`date /t`) DO set dobackup = %%i
Posted: 01/07/2009 @ 09:07 PM (PST)
avatar
a.barnes@...     22
Job Role: Technical/PC Support
Location: Auburn, New South Wales
Member since: 06/09/2003

View Profile  | Send Message
Post a Reply Save
« Previous  |  Next »

Print/View all Posts | Subscribe to this Thread 

FOR statement "unexpected i" in batch?dustin@... | 07/25/2005 @ 12:56 PM (PDT)
It would seem that the /i switch is not require...speeder-net | 07/25/2005 @ 04:52 PM (PDT)
FOR at console and in batch used differentlya.barnes@... | 01/07/2009 @ 09:07 PM (PST)

SponsoredWhite Papers, Webcasts, and Downloads

White Papers, Webcasts, and Downloads

Browse by Tag

networking
Popular tags: windows,  software,  hardware,  security,  it management
e-mail
Popular tags: windows,  software,  networking,  security,  hardware
hardware
Popular tags: windows,  software,  networking,  it management,  security
programming
Popular tags: software,  windows,  networking,  hardware,  it management
software
Popular tags: windows,  hardware,  networking,  programming,  it management
windows
Popular tags: software,  networking,  hardware,  security,  it management
linux
Popular tags: software,  windows,  networking,  hardware,  security
it management
Popular tags: networking,  windows,  software,  security,  hardware
career
Popular tags: it management,  networking,  software,  windows,  feedback
security
Popular tags: networking,  windows,  software,  it management,  hardware
off-topic
Popular tags: software,  windows,  hardware,  feedback,  networking
feedback
Popular tags: software,  windows,  hardware,  networking,  it management
project management
Popular tags: it management,  software,  networking,  windows,  programming
IT Professional's Guide to Policies and Procedures, Third Ed
Whether you're creating policies for management, training, personnel, support, privacy, Internet/e-mail usage, security, or inventory, you'll meet the needs of your entire enterprise with this one download!
Buy Now
Administrator's Guide to TCP/IP, Second Edition
Maintain your critical TCP/IP system and ensure reliable, safe remote access. Get the expert advice and solutions to handle Windows networking, Cisco routing, documentation, and troubleshooting.
Buy Now

SmartPlanet

Click Here