If then Question

View: New views
15 Messages — Rating Filter:   Alert me  

If then Question

by habs3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi All

First thanks for all the help in the past this is really a great group..

I have a task where i have to go through a few process to kill one so i was wondering ho i could process an itiration of processes to go through an kill the one the user enters. I have the following.

@Echo Off
set INPUT=
set /P INPUT= Enter Process Name: %=%
If %input% = adusrv.exe goto End
If %input% = armsrv.exe goto End
If %input% = blendersrv.exe goto End

:End

pskill.exe %input%

exit

:error
Echo " It appears you did not put in the right process name"
ping -n 15 127.0.0.1 > nul
exit
:Exit
Echo " Process was killed. Please check task manager to verify"
ping -n 15 127.0.0.1 > nul
Exit


I am looking to have the user put in the process they want to kill and if it is not one of the following to just end with an output error if it is one of the process in the list to kill it and exit. Thank you for any assistance.



     

Re: If then Question

by foxidrive-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 6 Jul 2009 09:32:47 -0700 (PDT), habs3 <habs3@...> wrote:

>I have a task where i have to go through a few process to kill one so i was wondering ho i could process an itiration of processes to go through an kill the one the user enters. I have the following.
>
>@Echo Off
>set INPUT=
>set /P INPUT= Enter Process Name: %=%
>If %input% = adusrv.exe goto End
>If %input% = armsrv.exe goto End
>If %input% = blendersrv.exe goto End
>
>:End
>
>pskill.exe %input%
>
>exit
>
>:error
>Echo " It appears you did not put in the right process name"
>ping -n 15 127.0.0.1 > nul
>exit
>:Exit
>Echo " Process was killed. Please check task manager to verify"
>ping -n 15 127.0.0.1 > nul
>Exit
>
>
>I am looking to have the user put in the process they want to kill and if it is not one of the following to just end with an output error if it is one of the process in the list to kill it and exit. Thank you for any assistance.

Try this (untested):

@Echo Off
:start
set INPUT=
set /P "INPUT=Enter Process Name to kill (filename.exe): "
if not defined input goto :start

set allowed=0
for %%a in (
adusrv.exe
armsrv.exe
blendersrv.exe
) do if /i "%input%"=="%%a" set allowed=1
if allowed EQU 0 goto :error

pskill.exe %input%

Echo An attempt to kill the "%input%" process was made -
echo Please check task manager to verify that it was successful.
rem or just check the errorlevel, if one was set
ping -n 15 127.0.0.1 > nul
goto :EOF

:error
Echo It appears you did not put in the right process name, try again
echo.
goto :start

Re: If then Question

by habs3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

Thanks for the quick response. this works but kills any process i put in. I only want the ones that are in the list.




________________________________
From: foxidrive <foxidrive@...>
To: batchworld@...
Sent: Monday, July 6, 2009 1:04:12 PM
Subject: Re: [BATCH WORLD] If then Question





On Mon, 6 Jul 2009 09:32:47 -0700 (PDT), habs3 <habs3@yahoo. com> wrote:

>I have a task where i have to go through a few process to kill one so i was wondering ho i could process an itiration of processes to go through an kill the one the user enters. I have the following.
>
>@Echo Off
>set INPUT=
>set /P INPUT= Enter Process Name: %=%
>If %input% = adusrv.exe goto End
>If %input% = armsrv.exe goto End
>If %input% = blendersrv.exe goto End
>
>:End
>
>pskill.exe %input%
>
>exit
>
>:error
>Echo " It appears you did not put in the right process name"
>ping -n 15 127.0.0.1 > nul
>exit
>:Exit
>Echo " Process was killed. Please check task manager to verify"
>ping -n 15 127.0.0.1 > nul
>Exit
>
>
>I am looking to have the user put in the process they want to kill and if it is not one of the following to just end with an output error if it is one of the process in the list to kill it and exit. Thank you for any assistance.

Try this (untested):

@Echo Off
:start
set INPUT=
set /P "INPUT=Enter Process Name to kill (filename.exe) : "
if not defined input goto :start

set allowed=0
for %%a in (
adusrv.exe
armsrv.exe
blendersrv.exe
) do if /i "%input%"==" %%a" set allowed=1
if allowed EQU 0 goto :error

pskill.exe %input%

Echo An attempt to kill the "%input%" process was made -
echo Please check task manager to verify that it was successful.
rem or just check the errorlevel, if one was set
ping -n 15 127.0.0.1 > nul
goto :EOF

:error
Echo It appears you did not put in the right process name, try again
echo.
goto :start

   


     

[Non-text portions of this message have been removed]


Re: If then Question

by foxidrive-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 6 Jul 2009 10:32:41 -0700 (PDT), habs3 <habs3@...> wrote:

>Thanks for the quick response. this works but kills any process i put in. I only want the ones that are in the list.

change
if allowed EQU 0 goto :error
to
if %allowed% EQU 0 goto :error

and it could fix it.  If not then put in

echo pskill %input%
pause

and see what is happening as I think your pskill syntax might need
checking.


>>
>>I am looking to have the user put in the process they want to kill and if it is not one of the following to just end with an output error if it is one of the process in the list to kill it and exit. Thank you for any assistance.
>
>Try this (untested):
>
>@Echo Off
>:start
>set INPUT=
>set /P "INPUT=Enter Process Name to kill (filename.exe) : "
>if not defined input goto :start
>
>set allowed=0
>for %%a in (
>adusrv.exe
>armsrv.exe
>blendersrv.exe
>) do if /i "%input%"==" %%a" set allowed=1
>if %allowed% EQU 0 goto :error
>
>pskill.exe %input%
>
>Echo An attempt to kill the "%input%" process was made -
>echo Please check task manager to verify that it was successful.
>rem or just check the errorlevel, if one was set
>ping -n 15 127.0.0.1 > nul
>goto :EOF
>
>:error
>Echo It appears you did not put in the right process name, try again
>echo.
>goto :start
>
>  
>
>
>      

Re: If then Question

by habs3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Again

I did the output with the pause and it does show the right process after pskill. I added notepad to the script to test with. It states that it killed it but notepad is still running. I added the screen shots.

@Echo Off
:start
set INPUT=
set /P "INPUT=Enter Process Name to kill (Filename.exe) : "
if not defined input goto :start
set allowed=0
for %%a in (
adusrv.exe
armsrv.exe
blendersrv.exe
notepad.exe
) do if "%input%"==" %%a" set allowed=1
if allowed EQU 0 goto :error

echo pskill %input%
pause

Echo An attempt to kill the "%input%" process was made -
echo Please check task manager to verify that it was successful.
rem or just check the errorlevel, if one was set
ping -n 15 127.0.0.1 > nul
goto :EOF

:error
Echo It appears you did not put in the right process name, try again
echo.
goto :start











________________________________
From: foxidrive <foxidrive@...>
To: batchworld@...
Sent: Monday, July 6, 2009 2:27:22 PM
Subject: Re: [BATCH WORLD] If then Question





On Mon, 6 Jul 2009 10:32:41 -0700 (PDT), habs3 <habs3@yahoo. com> wrote:

>Thanks for the quick response. this works but kills any process i put in. I only want the ones that are in the list.

change
if allowed EQU 0 goto :error
to
if %allowed% EQU 0 goto :error

and it could fix it.  If not then put in

echo pskill %input%
pause

and see what is happening as I think your pskill syntax might need
checking.

>>
>>I am looking to have the user put in the process they want to kill and if it is not one of the following to just end with an output error if it is one of the process in the list to kill it and exit. Thank you for any assistance.
>
>Try this (untested):
>
>@Echo Off
>:start
>set INPUT=
>set /P "INPUT=Enter Process Name to kill (filename.exe) : "
>if not defined input goto :start
>
>set allowed=0
>for %%a in (
>adusrv.exe
>armsrv.exe
>blendersrv. exe
>) do if /i "%input%"==" %%a" set allowed=1
>if %allowed% EQU 0 goto :error
>
>pskill.exe %input%
>
>Echo An attempt to kill the "%input%" process was made -
>echo Please check task manager to verify that it was successful.
>rem or just check the errorlevel, if one was set
>ping -n 15 127.0.0.1 > nul
>goto :EOF
>
>:error
>Echo It appears you did not put in the right process name, try again
>echo.
>goto :start
>
>
>
>
>

   


     

[Non-text portions of this message have been removed]


Re: If then Question

by foxidrive-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 7 Jul 2009 07:14:16 -0700 (PDT), habs3 <habs3@...> wrote:

>I did the output with the pause and it does show the right process after pskill. I added notepad to the script to test with. It states that it killed it but notepad is still running. I added the screen shots.

This works here under XP:


@Echo Off
:start
set INPUT=
set /P "INPUT=Enter Process Name to kill (Filename.exe) : "
if not defined input goto :start
set allowed=0
for %%a in (
adusrv.exe
armsrv.exe
blendersrv.exe
notepad.exe
) do if /i "%input%"=="%%a" set allowed=1
if %allowed% EQU 0 goto :error

pskill %input%

Echo An attempt to kill the "%input%" process was made -
echo Please check task manager to verify that it was successful.
rem or just check the errorlevel, if one was set
ping -n 15 127.0.0.1 > nul
goto :EOF

:error
Echo It appears you did not put in the right process name, try again
echo.
goto :start



Re: If then Question

by habs3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Excellent...

This works for me now as well. I think the issue was on my part why doing a copy and paste into notepad. there seems to have been an extra space after the ==" %%A" when i copied it. I removed the space and it works great now....

Thanks again for the help




________________________________
From: foxidrive <foxidrive@...>
To: batchworld@...
Sent: Tuesday, July 7, 2009 10:59:00 AM
Subject: Re: [BATCH WORLD] If then Question





On Tue, 7 Jul 2009 07:14:16 -0700 (PDT), habs3 <habs3@yahoo. com> wrote:

>I did the output with the pause and it does show the right process after pskill. I added notepad to the script to test with. It states that it killed it but notepad is still running. I added the screen shots.

This works here under XP:

@Echo Off
:start
set INPUT=
set /P "INPUT=Enter Process Name to kill (Filename.exe) : "
if not defined input goto :start
set allowed=0
for %%a in (
adusrv.exe
armsrv.exe
blendersrv.exe
notepad.exe
) do if /i "%input%"==" %%a" set allowed=1
if %allowed% EQU 0 goto :error

pskill %input%

Echo An attempt to kill the "%input%" process was made -
echo Please check task manager to verify that it was successful.
rem or just check the errorlevel, if one was set
ping -n 15 127.0.0.1 > nul
goto :EOF

:error
Echo It appears you did not put in the right process name, try again
echo.
goto :start


   


     

[Non-text portions of this message have been removed]


Cannot delete empty folder for some reason

by Aristos M. Vasiliou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am using this batch file to create another batch file in %tmp% which will delete "C:\webserver"

>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO.@ECHO off
>>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO RD /S /Q "%HOMEDRIVE%\webserver"
>>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO ECHO Easy Web Server was successfully removed from your computer
>>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO PAUSE
cd /d "%TMP%"
"%TMP%.\Uninstall_EasyWebServer.cmd"

My problem is that the batch file created in %tmp% cannot delete "C:\webserver" and the error message is "The process cannot access the file because it is being used by another process." Which is weird because C:\webserver is just an empty folder.

So I downloaded Process Monitor to see which process is keeping C:\webserver in use and found that no process is keeping that folder in use.

Do you see anything in that batch file that could be causing this problem?

Thanks



[Non-text portions of this message have been removed]


Re: Cannot delete empty folder for some reason

by foxidrive-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 12 Jul 2009 12:17:29 +0300, "Aristos Vasiliou"
<aristos@...> wrote:

>I am using this batch file to create another batch file in %tmp% which will delete "C:\webserver"
>
>>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO.@ECHO off
>>>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO RD /S /Q "%HOMEDRIVE%\webserver"
>>>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO ECHO Easy Web Server was successfully removed from your computer
>>>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO PAUSE
>cd /d "%TMP%"
>"%TMP%.\Uninstall_EasyWebServer.cmd"
>
>My problem is that the batch file created in %tmp% cannot delete "C:\webserver" and the error message is "The process cannot access the file because it is being used by another process." Which is weird because C:\webserver is just an empty folder.
>
>So I downloaded Process Monitor to see which process is keeping C:\webserver in use and found that no process is keeping that folder in use.
>
>Do you see anything in that batch file that could be causing this problem?
>
>Thanks


%temp% is normally the place rather than %tmp%

There may be a permissions issue because it is in the root of C: but try
this batch file to see if it works on your PC.  It works here in XP.


@echo off
md "%HOMEDRIVE%\webserver"
cd /d "%HOMEDRIVE%\webserver"
dir
set file="%TEMP%.\Uninstall_EasyWebServer.cmd"
 > %file% ECHO.@ECHO off
>> %file% ECHO RD /S /Q "%HOMEDRIVE%\webserver"
>> %file% ECHO ECHO Easy Web Server was successfully removed from your computer
>> %file% ECHO PAUSE
cd /d "%TEMP%"
dir "Uninstall_EasyWebServer.cmd"
"Uninstall_EasyWebServer.cmd"



RE: Cannot delete empty folder for some reason

by Aristos M. Vasiliou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

As always, you're the best Mic :)
 
Thanks

________________________________

From: batchworld@... on behalf of foxidrive
Sent: Sun 7/12/2009 6:23 PM
To: batchworld@...
Subject: Re: [BATCH WORLD] Cannot delete empty folder for some reason





On Sun, 12 Jul 2009 12:17:29 +0300, "Aristos Vasiliou"
<aristos@... <mailto:aristos%40aristos.net> > wrote:

>I am using this batch file to create another batch file in %tmp% which will delete "C:\webserver"
>
>>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO.@ECHO off
>>>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO RD /S /Q "%HOMEDRIVE%\webserver"
>>>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO ECHO Easy Web Server was successfully removed from your computer
>>>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO PAUSE
>cd /d "%TMP%"
>"%TMP%.\Uninstall_EasyWebServer.cmd"
>
>My problem is that the batch file created in %tmp% cannot delete "C:\webserver" and the error message is "The process cannot access the file because it is being used by another process." Which is weird because C:\webserver is just an empty folder.
>
>So I downloaded Process Monitor to see which process is keeping C:\webserver in use and found that no process is keeping that folder in use.
>
>Do you see anything in that batch file that could be causing this problem?
>
>Thanks

%temp% is normally the place rather than %tmp%

There may be a permissions issue because it is in the root of C: but try
this batch file to see if it works on your PC. It works here in XP.

@echo off
md "%HOMEDRIVE%\webserver"
cd /d "%HOMEDRIVE%\webserver"
dir
set file="%TEMP%.\Uninstall_EasyWebServer.cmd"
> %file% ECHO.@ECHO off
>> %file% ECHO RD /S /Q "%HOMEDRIVE%\webserver"
>> %file% ECHO ECHO Easy Web Server was successfully removed from your computer
>> %file% ECHO PAUSE
cd /d "%TEMP%"
dir "Uninstall_EasyWebServer.cmd"
"Uninstall_EasyWebServer.cmd"






[Non-text portions of this message have been removed]


progress bar

by Aristos M. Vasiliou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

Is there a way to add some kind of progress indicator in a batch file? Maybe stars, or something going like this \|/-\|/- You know something like a spinning line.

It doesn't have to be exact, just something showing the user that things are moving. I want to use this while installing programs using a batch file.

Thanks



[Non-text portions of this message have been removed]


Re: progress bar

by Theodorik OBroin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

  Cheers for getting me to look at this again.

  I find the easiest way is to update the title - that way you don't have to
do a CLS all the time.

  The reason for the two lines of ping -n, is that it's quicker for ping to
do a double ping of a second each, versus a single ping of two seconds.
  Try it out for yourself.

  Let me know how you get on :o)

  Here's my version thus far:

:: begin spin.cmd
@echo off
setlocal

set COUNT=0
set MAXCOUNT=10
set SECONDS=1

:LOOP
title "\"
call :WAIT
title "|"
call :WAIT
title "/"
call :WAIT
title "-"
if /i "%COUNT%" equ "%MAXCOUNT%" goto :EXIT
set /a count+=1
echo %COUNT%
goto :LOOP

:WAIT
ping -n %SECONDS% 127.0.0.1 > nul
ping -n %SECONDS% 127.0.0.1 > nul
goto :EOF

:EXIT
title FIN!
endlocal
:: end spin.cmd




2009/8/12 Aristos Vasiliou <aristos@...>

>
>
> Hello,
>
> Is there a way to add some kind of progress indicator in a batch file?
> Maybe stars, or something going like this \|/-\|/- You know something like a
> spinning line.
>
> It doesn't have to be exact, just something showing the user that things
> are moving. I want to use this while installing programs using a batch file.
>
> Thanks
>
> [Non-text portions of this message have been removed]
>
>  
>


[Non-text portions of this message have been removed]


Re: progress bar

by Josh Fitzgerald :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Check out this post on stack overflow:

How to code a spinner for waiting processes in a batch file?
<http://stackoverflow.com/questions/368041/how-to-code-a-spinner-for-wai\
ting-processes-in-a-batch-file/>




--- In batchworld@..., "Aristos Vasiliou" <aristos@...>
wrote:
>
> Hello,
>
> Is there a way to add some kind of progress indicator in a batch file?
Maybe stars, or something going like this \|/-\|/- You know something
like a spinning line.
>
> It doesn't have to be exact, just something showing the user that
things are moving. I want to use this while installing programs using a
batch file.
>
> Thanks
>
>
>
> [Non-text portions of this message have been removed]
>




[Non-text portions of this message have been removed]


RE: progress bar

by Aristos M. Vasiliou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

 

Thanks for your reply. This is my batch file so far.

 

@ECHO off

title Installing Software

ECHO.

ECHO Instaling Net Framework

dotnetfx35.exe /qb /norestart

ECHO.

ECHO Instaling TextPad

TextPad 5.msi /qb

ECHO.

ECHO All Software Installed

EXIT

 

How do I integrate your batch file with mine?

 

Thanks  

 

From: batchworld@... [mailto:batchworld@...] On
Behalf Of Theodorik OBroin
Sent: Wednesday, August 12, 2009 7:46 PM
To: batchworld@...
Subject: Re: [BATCH WORLD] progress bar

 

 

Hi,

Cheers for getting me to look at this again.

I find the easiest way is to update the title - that way you don't have
to
do a CLS all the time.

The reason for the two lines of ping -n, is that it's quicker for ping
to
do a double ping of a second each, versus a single ping of two seconds.
Try it out for yourself.

Let me know how you get on :o)

Here's my version thus far:

:: begin spin.cmd
@echo off
setlocal

set COUNT=0
set MAXCOUNT=10
set SECONDS=1

:LOOP
title "\"
call :WAIT
title "|"
call :WAIT
title "/"
call :WAIT
title "-"
if /i "%COUNT%" equ "%MAXCOUNT%" goto :EXIT
set /a count+=1
echo %COUNT%
goto :LOOP

:WAIT
ping -n %SECONDS% 127.0.0.1 > nul
ping -n %SECONDS% 127.0.0.1 > nul
goto :EOF

:EXIT
title FIN!
endlocal
:: end spin.cmd

2009/8/12 Aristos Vasiliou <aristos@...
<mailto:aristos%40aristos.net> >

>
>
> Hello,
>
> Is there a way to add some kind of progress indicator in a batch file?
> Maybe stars, or something going like this \|/-\|/- You know something
like a
> spinning line.
>
> It doesn't have to be exact, just something showing the user that
things
> are moving. I want to use this while installing programs using a batch
file.
>
> Thanks
>
> [Non-text portions of this message have been removed]
>
>
>

[Non-text portions of this message have been removed]





__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4329 (20090812) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

 

__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4330 (20090812) __________

 

The message was checked by ESET NOD32 Antivirus.

 

http://www.eset.com



[Non-text portions of this message have been removed]


Re: progress bar

by Theodorik OBroin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

  Cheers to Josh for his link.

  I've taken the batch file listed there, and together with your script,
have created a different script.
  I dunno about you, but when I ran the batch file listed in Josh's link, it
didn't do the backspace for me.

  I chose this, as I found the flaw in my program.  It would only rotate
when it was not installing something, which wasn't what you wanted.
  This program does what I would have done, except it works.

  The only prerequisite is that you have the .net framework and textpad
installers in the same directory as the batch file.

  I have only tested it with the "notepad", and what I see is that while
notepad is open, the spinner works. :o)
  Just close each notepad to see the program advance.

:: begin Net-Textpad-Installer.cmd
@echo off

:: Localise environment.
setlocal
cls

:: Specify directories. Your current working directory is used
:: to create temporary files tmp_*.*
set wkdir=%~dp0%
:: For testing, uncomment the next line to show what the above line does
:: echo %wkdir%
set wkdir=%wkdir:~0,-1%
:: For testing, uncomment the next line to show what the above line does
:: echo %wkdir%

:: First pass, Installing .Net Framework
:: Use Last to find out if this is the last program to install
set Last=0
del "%wkdir%\tmp_*.*" 2>nul
echo >>"%wkdir%\tmp_payload.cmd" dotnetfx35.exe /qb /norestart
:: For testing, comment out the above line, and uncomment the line below
:: echo >>"%wkdir%\tmp_payload.cmd" notepad
echo >>"%wkdir%\tmp_payload.cmd" del "%wkdir%\tmp_payload.flg"
:: On the next line, I removed the numerical value at the end with the app
being installed, so as to inform the user
call :monitor "%wkdir%\tmp_payload.cmd" "%wkdir%\tmp_payload.flg" .Net
Framework

:: Second pass, Installing Textpad
:: This is the last program to be installed, so FIN! will appear in the
title
set Last=1
del "%wkdir%\tmp_*.*" 2>nul:
echo >>"%wkdir%\tmp_payload.cmd" TextPad 5.msi /qb
:: For testing, comment out the above line, and uncomment the line below
:: echo >>"%wkdir%\tmp_payload.cmd" notepad
echo >>"%wkdir%\tmp_payload.cmd" del "%wkdir%\tmp_payload.flg"
:: On the next line, I removed the numerical value at the end with the app
being installed, so as to inform the user
call :monitor "%wkdir%\tmp_payload.cmd" "%wkdir%\tmp_payload.flg" Textpad

goto :final

:monitor
    :: Create flag file and start the payload minimized.
    echo >>%2 dummy
    start /min cmd.exe /c "%1"

    :: Start monitoring.
    ::    i is the indicator (0=|,1=/,2=-,3=\).
    set i=0

    :: Loop here awaiting completion.
    :loop
        :: Wait one second.
:: For a fast spinner, use -n 1
:: For a slow spinner, use -n 2
        ping 127.0.0.1 -n 1 >nul

        :: Update counters and output progress indicator.
        set /a "i = i + 1"
        if %i% equ 4 set i=0
        if %i% equ 0 <nul (title Installing %3 %4 "|")
        if %i% equ 1 <nul (title Installing %3 %4 "/")
        if %i% equ 2 <nul (title Installing %3 %4 "-")
        if %i% equ 3 <nul (title Installing %3 %4 "\")

        :: End conditions, wait until application finished installing.
        if not exist %2 (
            echo.   %3 %4 Installed.
            if %Last% equ 1 (
                title FIN!
            )
            del "%wkdir%\tmp_*.*" 2>nul
            goto :final
        )
        goto :loop
:final
endlocal

:: end Net-Textpad-Installer.cmd





2009/8/12 Aristos Vasiliou <aristos@...>

>
>
> Hi,
>
> Thanks for your reply. This is my batch file so far.
>
> @ECHO off
>
> title Installing Software
>
> ECHO.
>
> ECHO Instaling Net Framework
>
> dotnetfx35.exe /qb /norestart
>
> ECHO.
>
> ECHO Instaling TextPad
>
> TextPad 5.msi /qb
>
> ECHO.
>
> ECHO All Software Installed
>
> EXIT
>
> How do I integrate your batch file with mine?
>
> Thanks
>
> From: batchworld@... <batchworld%40yahoogroups.com> [mailto:
> batchworld@... <batchworld%40yahoogroups.com>] On
> Behalf Of Theodorik OBroin
> Sent: Wednesday, August 12, 2009 7:46 PM
> To: batchworld@... <batchworld%40yahoogroups.com>
> Subject: Re: [BATCH WORLD] progress bar
>
>
> Hi,
>
> Cheers for getting me to look at this again.
>
> I find the easiest way is to update the title - that way you don't have
> to
> do a CLS all the time.
>
> The reason for the two lines of ping -n, is that it's quicker for ping
> to
> do a double ping of a second each, versus a single ping of two seconds.
> Try it out for yourself.
>
> Let me know how you get on :o)
>
> Here's my version thus far:
>
> :: begin spin.cmd
> @echo off
> setlocal
>
> set COUNT=0
> set MAXCOUNT=10
> set SECONDS=1
>
> :LOOP
> title "\"
> call :WAIT
> title "|"
> call :WAIT
> title "/"
> call :WAIT
> title "-"
> if /i "%COUNT%" equ "%MAXCOUNT%" goto :EXIT
> set /a count+=1
> echo %COUNT%
> goto :LOOP
>
> :WAIT
> ping -n %SECONDS% 127.0.0.1 > nul
> ping -n %SECONDS% 127.0.0.1 > nul
> goto :EOF
>
> :EXIT
> title FIN!
> endlocal
> :: end spin.cmd
>
> 2009/8/12 Aristos Vasiliou <aristos@... <aristos%40aristos.net>
> <mailto:aristos%40aristos.net <aristos%2540aristos.net>> >
>
> >
> >
> > Hello,
> >
> > Is there a way to add some kind of progress indicator in a batch file?
> > Maybe stars, or something going like this \|/-\|/- You know something
> like a
> > spinning line.
> >
> > It doesn't have to be exact, just something showing the user that
> things
> > are moving. I want to use this while installing programs using a batch
> file.
> >
> > Thanks
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
>
> [Non-text portions of this message have been removed]
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4329 (20090812) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4330 (20090812) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
> [Non-text portions of this message have been removed]
>
>  
>


[Non-text portions of this message have been removed]