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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:47:18+00:00 2026-06-15T18:47:18+00:00

I have the following code: @ECHO OFF IF EXIST comandosAEjecutar.tpl (DEL comandosAEjecutar.tpl) ECHO Procesando

  • 0

I have the following code:

@ECHO OFF

    IF EXIST comandosAEjecutar.tpl (DEL comandosAEjecutar.tpl)

    ECHO Procesando archivos a subir...
    FOR /f "tokens=1 delims=," %%g IN (config.tpl) DO ECHO open %%g>> comandosAEjecutar.tpl
    FOR /f "tokens=2 delims=," %%g IN (config.tpl) DO ECHO %%g>> comandosAEjecutar.tpl
    FOR /f "tokens=3 delims=," %%g IN (config.tpl) DO ECHO %%g>> comandosAEjecutar.tpl
    ECHO binary>> comandosAEjecutar.tpl
    FOR /f "tokens=4 delims=," %%g IN (config.tpl) DO ECHO cd %%g>> comandosAEjecutar.tpl
    FOR /f "tokens=5 delims=," %%p IN (config.tpl) DO @SET pathLocal=%%p

    FOR /r . %%g IN (%pathLocal%\*.txt %pathLocal%\*.zip) DO ECHO delete %%~nxg>> comandosAEjecutar.tpl
    FOR /r . %%g IN (%pathLocal%\*.txt %pathLocal%\*.zip) DO ECHO put %%~nxg>> comandosAEjecutar.tpl

    ECHO bye>> comandosAEjecutar.tpl

    ECHO Comienzo de la sesion FTP...

    FTP -i -s:"comandosAEjecutar.tpl"

    ECHO Finalizado.
    PAUSE
    EXIT

The actual problem is in the following lines:

    FOR /f "tokens=5 delims=," %%p IN (config.tpl) DO @SET pathLocal=%%p

    FOR /r . %%g IN (%pathLocal%\*.txt %pathLocal%\*.zip) DO ECHO delete %%~nxg>> comandosAEjecutar.tpl
    FOR /r . %%g IN (%pathLocal%\*.txt %pathLocal%\*.zip) DO ECHO put %%~nxg>> comandosAEjecutar.tpl

I know that the variable “pathLocal” is being set correctly, as I did an ECHO and it showed the correct path, something like: \\red\C\pc\pc.com\serv\down\bol

The problem is that the two following lines are not interpreting the variable as a path, as they are producing no results, when I do have .txt and .zip files on that directory.

  • 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-15T18:47:19+00:00Added an answer on June 15, 2026 at 6:47 pm

    I believe your problem is the pathlocal variable being in the parenthesis, try moving it after the /r

    FOR /r %pathLocal% %%g IN (*.txt *.zip) DO ECHO delete %%~nxg>> comandosAEjecutar.tpl
    FOR /r %pathLocal% %%g IN (*.txt *.zip) DO ECHO put %%~nxg>> comandosAEjecutar.tpl
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following batch file code: @echo off SET INSTALL_PATH=c:\program files\ :ask_again if exist
I have the following code in my batch file @ECHO OFF SET /P NAME=Enter
I have a batch file using the following code: @echo off :: BatchGotAdmin :-------------------------------------
I have the following code: echo ' <td> <input type=button name=delete value=X onclick=clearSelection(this.form, '.$type.');this.form.submit();
So I have the following code: echo '<li><a href="'.$Website.$Elements[2].'/'.$Row["povezava"].'" class="leftMenuArticlesInactive"></a><li>'; $Website contains: http://www.somesite.com/test/ $Elements[2]
I have the following code: while ($content = mysql_fetch_array($content2)){ echo $content[0]; session_start(); $_SESSION['content'] =
I have the following code: for($n=1; $n<=100; $n++) { echo $n . '<br />';
i have the following code : <input type=text value=<?php echo $_GET['msg']; ?>> This input
I have the following code: <div><strong>Name: </strong><?php echo anchor('http://'.$link, $row->Name); ?></div> Which takes a
I have the following PHP code: <?php if(isset($_GET['article'])) { echo <b>success</b>; } ?> And

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.