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 825599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:16:56+00:00 2026-05-15T03:16:56+00:00

i am refering to this question ASSIGN win XP commandline output to variable i

  • 0

i am refering to this question
ASSIGN win XP commandline output to variable

i am trying to use it on a powershell code segment
so i typed

powershell date (get-date).AddDays(-1) -format yyyyMMdd

and confirm it returns like

20100601

but then if i tried to

for /f "tokens=*" %a in ('powershell date get-date -format yyyyMMdd
') do set var=%a

then it failed to work as expected. how can i transfer the date to a variable?

  • 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-15T03:16:57+00:00Added an answer on May 15, 2026 at 3:16 am

    Maybe

    for /f "tokens=*" %a in ('powershell "get-date; get-date -format yyyyMMdd"') do set var=%a
    

    is what you wanted.

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

Sidebar

Ask A Question

Stats

  • Questions 542k
  • Answers 542k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers

Top Members

Related Questions

Refering to a previously asked question , I would like to know how to
I am refering to the question on changing the classpath programmatically. I read and
I know this is probably a first year question, but I'm having some problems
This question is a follow up to my previous Java GC question: Java Garbage
I'm used to work in Java, so perhaps this question is a Java-oriented Perl
I've heard people referring to this table and was not sure what it was
I'm referring to distinctions such as in this answer : ...bash isn't for writing
Referring to TLB and maintenance issues ... My question to people (often) using the
I would like to provide the raw text referring to an environment variable to
Some comments on Stack Overflow question Why doesn't the C# compiler stop properties from

Explore

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.