Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
242 views
in Technique[技术] by (71.8m points)

batch file - Get the wget title away(and keep my own)

I have a batchfile and it contents this code:

Title Updater
timeout /t 5 /nobreak
wget -q -OUpdate.zip https://www.dropbox.com/s/e9q3ssvhitsatbq/Update.zip --no-check-certificate

The title "Updater" is showing the first five seconds and then when it starts to download, it changes to a wget title. Here. Take a look(a pictuer of my almost-complete program).: Picture: Screenshot of the command line while wget is in use

All I want is to keep the "Updater" title.

Could somebody help me please?

EDIT: This is the whole code shown on the picture. All written by myself(Don't ask me why it is written this way! Do not try to steal it or shorter it, because it works the way it is!):

-SOURCE REMOVED-

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This might not be the perfect solution you are looking for, but if you want a 'quick fix', then this could help you out.

if you simply change this code

:continue1
cls
Title Downloading...
FOR /F "usebackq tokens=*" %%A IN (`wget -S --spider --no-check-certificate %URL% 2^>^&1 ^| FINDSTR "Content-Length: "`) DO (
    SET SIZE=%%A
)

into

:continue1
cls
FOR /F "usebackq tokens=*" %%A IN (`wget -S --spider --no-check-certificate %URL% 2^>^&1 ^| FINDSTR "Content-Length: "`) DO (
    SET SIZE=%%A
)
Title Downloading...

Then the title will display Downloading.

The downside to this quick fix is that the wget title will be displayed for a fraction of a second.

Hopefully this helps you out.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...