Computing.Net > Forums > Programming > Pause for Specified time.

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Pause for Specified time.

Reply to Message Icon

Name: Shyam Kumar
Date: May 14, 2007 at 03:54:30 Pacific
OS: XP
CPU/Ram: 2GB
Comment:

Hi,

Can anybody give the command to pause the process for a specified amount of time.

I got this problem becasue in my batch script.

My program tries to install a software.
But when the installation termiates after a fraction of min.
Then i tried with pause command. then the istallation is going fine. As i know the installation completes by seeing the files i can press any key to close the CMD window.

But the users dont know about installation files. If i gave the program using "pause" they may close the CMD window as soon as the message "press any key to continue...".

I dont want to do like that.. So, please can anybody tell the command to pause the process for specified amount of time...


Thanks in advance,
Shyam.

Shyam Kumar



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: May 14, 2007 at 04:15:42 Pacific
Reply:

ping 1.1.1.1 -n 1 -w 10000 > nul
===========================
the time to wait is the 10000, time in milliseconds, so this waits 10 seconds.



=====================================
If at first you don't succeed, you're about average.

M2



0

Response Number 2
Name: Shyam Kumar
Date: May 14, 2007 at 06:40:04 Pacific
Reply:

Hi Mechanix2Go,

The command you gave is not working in my code. Same thing happenening. my installation is aborting in between as usual.

I am giving u the full code what i made.

@echo off
Title OA or PVLite or PVThick Installation

if not defined JAVA_HOME set /p JAVA_HOME=Please enter JAVA_HOME:

set PATH=%JAVA_HOME%\bin;%PATH%

set /p Component=Please enter Viz component to install[OA/LITE/THICK]

set /p Build=Please enter the build to install

if "%Component%"=="OA" set loc=\\i2851\Viz_CD_Images\OA\X-10\%Build%\adapters_win.01
if "%Component%"=="LITE" set loc=\\i2851\Viz_CD_Images\PView\X10\%Build%\pviewrun.01
if "%Component%"=="THICK" set loc=\\i2851\Viz_CD_Images\PView\X10\%Build%\productview.01

set /p installer=Please enter the path to installer properties file of "%Component%":

for /f "tokens=2 delims==" %%i in ('findstr /C:"USER_INSTALL_DIR=" "%installer%"') do set install_loc=%%i

Set install_loc=%install_loc:\:=:%

Set install_loc=%install_loc:\\=\%

pushd "%loc%"

if "%Component%"=="THICK" (
echo %installer%
echo Installing ProductView ............
start /wait setup -f %installer% -i silent
pause
goto EOF
)

if "%Component%"=="OA" (
echo %installer%
rmdir /s /q "%install_loc%"
echo Installing OA............
start /wait setup -f %installer% -i silent

ping 1.1.1.1 -n 1 -w 300000 > null
goto EOF
)
if "%Component%"=="LITE" (
echo %installer%
echo Installing ProductView Lite............
start /wait setup -f %installer% -i silent
pause
goto EOF
)

:EOF

Output of batch file:
Please enter JAVA_HOME:d:\j2sdk1.4.2_06
Please enter Viz component to install[OA/LITE/THICK]OA
Please enter the build to install101
Please enter the path to installer properties file of "OA":c:\vizadapters-instal
ler.properties
c:\vizadapters-installer.properties
Installing OA............

After showing "Insatalling OA.."... it is closing in between of the installation....


Thanks in Advance,
Shyam.


Shyam Kumar


0

Response Number 3
Name: IVO
Date: May 14, 2007 at 07:18:45 Pacific
Reply:

By a quick watch I suppose your code never executes the ping command given by M2 as it abends while running setup.

Why do you code Start /wait setup as its effects is the same of the simple setup...?

A cause may be the Set Path statement at the beginning as I experienced the impossibility of modifing the native Path system variable via a batch script.


0

Response Number 4
Name: Mechanix2Go
Date: May 14, 2007 at 07:37:59 Pacific
Reply:

It will take me a while to figure out what's going on in all that ECHOing and prompting.

One thing I notice is that you don't need to indicate where EOF is with :EOF because it is 'built in'. But, strangely, you do need to code:

goto :eof


=====================================
If at first you don't succeed, you're about average.

M2



0

Response Number 5
Name: Shyam Kumar
Date: May 14, 2007 at 09:43:14 Pacific
Reply:

Yes M2. wat you said regarding :EOF is correct.. actually i tried with out that... as it is not working i tried with different ways..

Shyam Kumar


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Pause for Specified time.

Effective tool for run-time errors and memory www.computing.net/answers/programming/effective-tool-for-runtime-errors-and-memory/19258.html

C++ Ticker www.computing.net/answers/programming/c-ticker/6563.html

Time limit software www.computing.net/answers/programming/time-limit-software/14542.html