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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:13:08+00:00 2026-06-13T08:13:08+00:00

I am trying to download a file using wget in batch file,I don’t want

  • 0

I am trying to download a file using wget in batch file,I don’t want to download the file if the file all ready exist and it didn’t change so I am using -N
also I am downloading the file from my personal FTP server so I want to hide my username and password details so I decided to hide output using >nul 2>&1
so my batch file is:

@echo off
blah blah
.....
echo please wait...
wget -N ftp://XXXXXXXXXX@YYYYYYY.com/file.jpg >nul 2>&1 

now there are 2 problems:

  1. The window title will still show my username & password , how I can hide the title or change the title ?

  2. the user wont know if the operation was successful (download was done) or fail (no Internet or no file exist) or it didn’t download because the file already exist , I wonder if I can make 3 IF STATEMENTS

    IF file was downloaded then echo file download
    
    IF file wasn't downloaded then echo error
    
    IF file wasn't downloaded because was the same then echo file didnt change
    
  • 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-13T08:13:09+00:00Added an answer on June 13, 2026 at 8:13 am

    I agree with PA that if the file is sensitive then hiding the password in the console output won’t do much in terms of security. However, to answer the OP’s question:

    1.
    The title command is capable of changing the current window’s title.

    title My CMD Window
    

    If the problem you’re encountering is that a popup window for the wget command is coming up and displaying the username and password there, you can use the following. I apologize, I am not familiar with wget so I’m not sure on its behavior, hopefully this helps.

    start "My WGET Window" wget -N ftp://XXXXXXXXXX@YYYYYYY.com/file.jpg >nul 2>&1
    

    2.
    A couple of checks before and after will be beneficial. First, check if the file exists and don’t even bother with the wget if it does already exists (assuming from the wording of your post that you do not want to overwrite the file).

    if exist file.jpg echo File already exists!&pause&goto :EOF
    :: run wget here
    if exist file.jpg (echo File download successful.) else (echo File download UNSUCCESSFUL.)
    

    We don’t need to check for all three conditions as the file either exists before hand (in which case the batch exits) or it does not in which case we test for a successful download. Note that it will be difficult to check for a partial file.

    So, putting it all together:

    @echo off
    blah blah
    .....
    title My CMD Window
    if exist file.jpg echo File already exists!&pause&goto :EOF
    echo please wait...
    start "My WGET Window" wget -N ftp://XXXXXXXXXX@YYYYYYY.com/file.jpg >nul 2>&1
    if exist file.jpg (echo File download successful.) else (echo File download UNSUCCESSFUL.)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On Ubuntu, I am trying to download a file (from a script) using wget.
Greetings all, I am trying to download 'gz' file using URL class .Code snippet
I am trying to automate the download of a file using wget and calling
I am trying to download a file using simple java class using the following
I am trying to download a file using simple java class using the following
I am trying to download a CSV file using HttpResponse to make sure that
I am trying to download a zip file by using the following code; HttpConnection
I am trying to download a file from a website using python and mechanize.
I am trying to download a pdf file on my mobile (using Java ME
I am trying to implement an Asynchronous file download from a web server using

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.