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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:42:31+00:00 2026-06-12T19:42:31+00:00

In my scipt i’m getting a string from a file and i would like

  • 0

In my scipt i’m getting a string from a file and i would like this string to be interpreted as a var:

for /f %%G in (..\..\outrep.txt) do SET AUTOIMPORTDIR=%%G

In my outrep.txt file I have: %USERPROFILE%

So I would like AUTOIMPORTDIR equals to C:\Documents and Settings\myUser
and it’s actually equals to %USERPROFILE%

What can i do to interpret this string as 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-06-12T19:42:32+00:00Added an answer on June 12, 2026 at 7:42 pm

    In this situation you can use one more instance of FOR /F to evaluate the string %USERPROFILE% using the option to execute the ECHO command:

    FOR /F %%G IN (..\..\outrep.txt) DO
        FOR /F "tokens=*" %%H IN ('ECHO %%G') DO SET AUTOIMPORTDIR=%%H
    

    Important detail: the tokens=* option is necessary if the value you want to fetch includes spaces or tabs.

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

Sidebar

Related Questions

The following code loads html content from a file (i used this thread )
I would like to have a shell scipt that runs infinitely and keeps checking
This script functions mostly how I would like it to: alert when a radio
Disregard this question: I've simply confused <script src=...></script> tag and <script> [some functions] </scipt>
I am using a Perl module called from a CGI scipt in IIS 6
I'm starting using XSLT and write this scipt: <?xml version=1.0 encoding=ISO-8859-1?> <xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform>
I wrote a .sh script which should upload data from file by sql*loader and
The scipt should subtract 1 from the primary key (auftrag_id) from a table. But
I am trying to call my linux executable from shell script. Before calling this
I have this scipt call: .... $objResponse->addScriptCall(my_script); return $objResponse->sendResponse(); This works ok but 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.