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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:52:32+00:00 2026-05-28T04:52:32+00:00

In a DOS script that I wrote, I am unable to figure out what

  • 0

In a DOS script that I wrote, I am unable to figure out what causes this error that I get:

The system cannot find the file specified.
Error occurred while processing: .exe.

Here is the script. Any help would be greatly appreciated. I tried to ask for help on the DosTips forum but I am getting no answer. :

@echo off
:: script to edit property files
CALL :PROPEDIT # Key4 Value446 test.properties    
GOTO :END    
:PROPEDIT [#] PropKey PropVal File
IF "%~1"=="#" (
  :: Passing a first argument of "#" will disable the line while editing
  SET "_PREFIX=#"
  SHIFT
)
IF NOT "%~4"=="" (
  ECHO Too many arguments.
  EXIT /B 1
)  
IF "%~3"=="" (
  ECHO PROPEDIT: Function requires 3 args: [#] PropKey PropVal File
  EXIT /B 1
) ELSE (
  SET "_PROPKEY=%~1"
  SET "_PROPVAL=%~2"
  SET "_FILE=%~3"
)
MOVE /Y "%_FILE%" "%_FILE%.bak">nul
FOR /F "USEBACKQ tokens=*" %%A IN (`TYPE "%_FILE%.bak" ^|FINDSTR /N /I "%_PROPKEY%="`) DO (
  SET LINE=%%A
)
FOR /F "tokens=1,2* delims=:" %%S IN ("%LINE%") DO SET LINE=%%S
SET /A COUNT=1
FOR /F "USEBACKQ delims=" %%A IN (`TYPE "%_FILE%.bak" ^|FIND /V /N ""`) DO (
  SET "LN=%%A"
  SETLOCAL ENABLEDELAYEDEXPANSION
  SET "LN=!LN:*]=!"
  IF "!COUNT!" NEQ "%LINE%" (
      ECHO(!LN!>>%_FILE%
  ) ELSE (
      ECHO %_PREFIX%%_PROPKEY%=%_PROPVAL%>>%_FILE%
      ECHO Updated '%_FILE%' with value '%_PREFIX%%_PROPKEY%=%_PROPVAL%'.
  )
  ENDLOCAL
  SET /A COUNT+=1
)
EXIT /B 0
:END
ECHO --- Finished Test ---
pause
  • 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-28T04:52:33+00:00Added an answer on May 28, 2026 at 4:52 am

    Remove the .EXE of FIND and TYPE

    You don’t need TYPE. You can do just this:

    FOR /F "tokens=*" %%A IN (`FIND /N /I "%_PROPKEY%=" "%_FILE%.bak"`) DO (
    

    If FIND spoils your results (by not using TYPE) then consider using FINDSTR instead and use ‘DELIMS=:‘ instead of ‘DELIMS=]‘

    If I’m right my assumption that the following is helpful, take a look at the ‘MORE +nnn‘ command (note the ‘+nnn‘ which outputs lines from a specific location in the file).

    Why not just place your ‘SETLOCAL ENABLE.. etc’ at the top of your code?

    If you explain what it is you’re trying to attempt, then I might be in a better position to help.

    Just a few thoughts 🙂

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

Sidebar

Related Questions

I have this small script that changes the background image with a fadein/out effect:
This DOS batch script is stripping out the blank lines and not showing the
I have a nightly build DOS batch script that invokes devenv.exe to build a
In a bash script, I'm using wine to call a DOS program that requires
ISQL-SE 4.10.DD6 (DOS 6.22): BCHECK C-ISAM B-tree Checker version 4.10.DD6 C-ISAM File: c:\dbfiles.dbs\*.* ERROR:
I've got a DOS program kicked off by a cmd script that dumps a
I have a sh/bash script that needs to call a batch file with parameters
I have a batch script that eventually starts another batch file and waits for
I have written a PHP Script, I run the code like this on MS-DOS
I have a DOS batch script that invokes a java application which interacts with

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.