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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:05:37+00:00 2026-05-21T14:05:37+00:00

Write variables to file as %VAR% not as the value of the variable, as

  • 0

Write variables to file as %VAR% not as the value of the variable, as well ask making tasklist function properly when redirecting output.

Code im using to write to file:

echo tasklist /FI "IMAGENAME eq %ZOEXT%" 2>NUL | find /I /N "%ZOEXT%">NUL >> boot.bat
echo if "%ERRORLEVEL%"=="1" start /d "%ZODIR%" %ZOEXT% >> boot.bat

Result:

tasklist /FI "IMAGENAME eq Zoiper.exe"  
if "0"=="1" start /d "C:\Documents and Settings\mgladman\Desktop\Zoip\Zoiper Communicator\" Zoiper.exe 

What I want added to boot.bat:

tasklist /FI "IMAGENAME eq %ZOEXT%" 2>NUL | find /I /N "%ZOEXT%">NUL
if "%ERRORLEVEL%"=="1" start /d "%ZODIR%" %ZOEXT%

If you want i can publish whole code not just segment, it is a cool script 😛 Just has this small issue.

Only “workaround” i can think is to make the first script, to echo echo in the first file and write the correct system data (this has to be a portable script, so that would work, but would be messy as)

  • 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-21T14:05:38+00:00Added an answer on May 21, 2026 at 2:05 pm

    You can escape the % using ^ if you are in command line.

    For example:

    set var=test
    echo %var%
    

    echoes test

    set var=test
    echo ^%var^%
    

    echoes %var%

    In batch file you have to use double % –

    set var=1
    echo %%var%%
    

    echoes %var%

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

Sidebar

Related Questions

I initialize the variables, use move_uploaded_file function and then I write a basic form
I put the following method in my application.js file. var formhandler = function() {
Possible Duplicate: Avoiding repeated constants in CSS I have a javascript file that I
I have a strange issue with to_json method in my Rails 3 app. (well
Question: How can I implement shared memory variable in PHP without the semaphore package
Are their any feature exist something like data template. i have a js file
This is my first attempt at a 'real' C# program. It takes a specified
Completely restated my question: Problem: Losing reference to an iFrame with Mozilla firefox 3.6
I have a number of files with the same naming scheme. As a sample,
I am problem scheduling and running a script through cron job. I am on

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.