Question

DOS script to Check if a file is older than 20 minutes

Asked by: sitaparijat

I need to check if an EDI process in our system is running. If it ihas failed the LOG file will not change.  I want a simple code that will check if a file is older than 20 minutes and give an error message.

Can some one provide me a script that I can just run in DOS/Windows? If there is any other trick it is welcome too,

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-09-24 at 17:52:22ID24760535
Tags

DOS

Topics

PHP Scripting Language

,

MS DOS

,

Windows Batch Scripting

Participating Experts
4
Points
250
Comments
24

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Move Files older than x minutes to another directory
    Hello, I haven't touched C++ in a while and I'd like to get back into it. I'm now using VC++ 6.0 (a new compiler to me). I would like to know how I would move all files in directory A to directory B (windows 2000 computer - program run locally) that are older than 5 minute...
  2. Batch File that will move files older than 7 days
    I need to create a batch file or a Perl Script that will look into a folder and move all the files that are older than 7 days to another folder. Any suggestions? Please.....
  3. Find files older than "x"  minutes
    Hi, My objective is to find a list of files that have not been modified since last "x" minutes (say 10 minutes). 1) Is there any equivalent of "-mmin" option in "find" command for Solaris? 2) Is there a way of achieving it using "-newer&qu...
  4. Select items that are older than 30 minutes.
    How do I grab anything with a createdDate that is at least 30 minutes + SELECT id,QuoteID,InstanceID,MergeProcess,MergeFileContent,AttachDocURL,MasterDocumentName,DocumentName,DeliveryMethod,BrokerEmail,Source FROM MergeFiles WHERE MergeFileCreationDate IS NU...
  5. Perl Files older than 10 minutes
    Hi Experts, OS: Windows 2000/2003 Using perl, what is the best way to check to see if there are any files older than say 10 minutes on a network share and then to report back the number of files? Thanks in advance.
  6. I need a Batch file to delete files older than 20 minutes.
    We have a scans folder that used to maintain all scans and I would periodically go in and delete the files out. Now I need to clean it out every 20 minutes. I have a scheduled task in Windows 2003 Server that runs every 20 minutes and deletes everything out of the folder. ...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: Mahdii7Posted on 2009-09-24 at 17:56:29ID: 25419404

Might want to request a zone change on this one.. primary is PHP

 

by: BillDLPosted on 2009-09-24 at 21:55:40ID: 25420096

Hello sitaparijat

Could you possibly do something for us that will be helpful for working out your times and checking the date of your file.  Open a command window on the computer that will be running the script and type the following commands:

echo %DATE%
echo %TIME%

We will need to know if your Date shows as DD/MM/YYYY or the USA format of Day MM/DD/YYYY.  If the HOUR in your current TIME is later than 10am, then could you perhaps change the system time (if possible) back to an hour with a single digit, ie. before 10am, and then do the   echo %TIME%  command again to see if the Hour shows as a single digit with a space in front of it, or if it adds a Zero in front of the single digit hour.  For example, does it show as:
 8:47:57.24
or
08:47:57.24

Knowing this will make it easier to present a script known to work on your system.  I think your formats will be the same as my UK ones:

DD/MM/YYYY
 8:47:57.24

Bill

 

by: BillDLPosted on 2009-09-24 at 22:14:36ID: 25420165

One other thing that would be very helpful to know.  Would you be scheduling the script to run at 20 minute intervals to check the status of the file?  It sounds as though you are monitoring a log file for the Last Write Time at intervals, is that correct?

 

by: dragon-itPosted on 2009-09-24 at 22:35:03ID: 25420233

one method that avoids timestamps altogether is to use a xcopy command.

Im on my phone at the mo. but basically:

script scheduled every 20 mins say
xcopy the log file if archive bit is set to new location
Check if the file has copied or there was an error
If the file hasn't copied then it hasn't been marked as needing archive so it hasn't been modified.

Same goes for xcopy /d which will copy if newer.

Othere than that BillDL is on the right track wanting to know the date #ime formats though I would say the date bit should be irrelevant and apart from within 20 mins of midnight a simple check of the time from the file vs current time would give you a yes/no.

Steve

 

by: sitaparijatPosted on 2009-09-25 at 01:57:46ID: 25421152

Dear All,
Thanks for the interest.

Pl let me know how I can change the zone for the question.

I did as BillDL suggested and here is what I have
C:\sFTP\Runtime>echo %DATE%
Fri 09/25/2009

C:\sFTP\Runtime>echo %TIME%
16:44:14.91




This is a server so I can not chnage the server time to (less than 10 AM) see how it will behave. I will do it tomorrow morning.
I intend to run this script every 20 minutes and send an email if the file is older than 20 minutes.
This is a server so I can not chnage the system time immediately. But I will try it tomorrow and let you know. Is there a way we can determine this from the regional settings in the control panel?

 

by: dragon-itPosted on 2009-09-25 at 02:13:05ID: 25421213

Don't change the system time... if it is part of a domain controller especialluy etc. could cause you all sorts of issues with replication and other time issues.

You don't need to change time, just look at the format in the morning :-)

Did you look at my suggestion of whether it would be OK to do this -- how big is this file?  You could also us fc.exe to compare the files.  If your script runs every 20 mins then anything that has not changed since the last run is over 20 mins old and therefore needs checking anyway.

@echo off
set logfile="C:\yourlogfile.txt"
echo f|xcopy /Y /M %logfile% "%temp%\logfile.txt" | find "0 File(s) copied"
if "%errorlevel%"=="0" (
 echo The file has not changed since the script was last ran
 dir %logfile% > bodyofemail.txt
 rem Use BLAT or whatever to send message
)

Steve

 

by: BillDLPosted on 2009-09-25 at 03:31:01ID: 25421550

Don't worry about changing the system time.  That gives me what we would need to write a script.

You said:
"I intend to run this script every 20 minutes and send an email if the file is older than 20 minutes."

Just to make sure of something.  You are testing to see if the EDI process DID NOT update the log file from the last time it was checked 20 minutes before that?

Does this mean that the EDI process starts, does what it needs to do, and then stops?

Does the EDI process run as a scheduled task also?  If so, then Scheduled Tasks creates and updates a log file %WinDir%\Schedlgu.txt, and in it you should see the error return codes that indicate success or failure:
0x0: Operation completed successfully
0x1: Incorrect or unknown function was called
0xa: Incorrect environment.

Scheduled Tasks runs as a Windows Service (Service Name = "Schedule", Display Name = "Task Scheduler"), so it should also be logged in the Event Viewer.  You can extract information from the event viewer logs using "%SystemRoot%\System32\Eventquery.vbs".  Syntax here:
http://technet.microsoft.com/en-us/library/cc772995(WS.10).aspx

If the EDI process runs all the time in the background, and all you really need to do is check to ensure that it is still running since checked 20 minutes ago, then you can easily check this from a batch file using the TASKLIST command and filtering results to show the current status of the process.

These are just some thoughts about other methods that might be available to you.  I need to go to bed now, but I'll look at this later.

 

by: BillDLPosted on 2009-09-25 at 03:34:14ID: 25421558

Thanks for stepping in quick with the warning about the time Steve.  I had a clunky but functional batch file that I just had to iron out two issues with, but the xcopy way is by far the easiest and best.  In fact, I had this comment almost typed out 45 minutes ago, but was diverted and didn't finish it.

 

by: dragon-itPosted on 2009-09-25 at 04:55:40ID: 25422068

sory wasn't trying to ruin your result (may be needed anwway don't have time  at the mo) but having seen servers have time changed - one big company effectively had a day a year or so ahead they had LOADs of things happen on because for a short periof a date had been put forward  on a dc, synced out to servers and all sorts of replication things get stamped with a dtae/time so effectuvely didn't work properly until that  new date... at which point old docs replicate back because it is past the window of how long deletions are kept for ... glad I wasn't working for the company at the time but saw some of the aftermath.
Not suggesting changing time by a fe hours would break as badly  but its too easy to accidentally press an arow in the wrong box and change the year by mistake etc!

Anyway will leave you to it but will be around if wanted.

BTW if the log file is held open it may not be possible to open it, or it might be too big to copy (in which case comparing the output line of dir with the previously kept output of dir would do I guess?

Steve

 

by: QlemoPosted on 2009-09-25 at 07:27:00ID: 25423282

To summarize and throw in new methods:

  • check for the scheduled task's status. This can be done similar to this lines: 
@echo off
for /F "tokens=*" %%L in ('schtasks /query /fo:csv /v /nh ^| find "MyTask"') do call :Process %%L

exit /b 0

:Process
echo Task %~2 has status %~6 (%4)
  • check for the archive attribute, sample: 
@echo off
set error=
for /F %%F in ('dir /b /a:-A logfile.log') do set error=yes
if defined error (echo Error: Nothing done^!) else (attrib -a logifle.log)

 

by: sitaparijatPosted on 2009-09-27 at 19:07:35ID: 25436391

Dear All,
I checked the system time and here how it looks.
C:\Documents and Settings\administrator.SCHENKER-ASIA>echo %time%
 9:33:38.17

The EDI process runs once  every ten-fifteen minutes and during which time it updates the log file with all the gory details of what it has done.. If it did not run for what ever reason. they we know about it..
It is not running continuously..

Btw, dragon-it 's script looks simple and might work... but can you fill me in on the detaisl of what the script does? I can understand a little.. but some still some questions remain..
 echo f|xcopy /Y /M %logfile% "%temp%\logfile.txt" | find "0 File(s) copied"
What is this exactly? xcopy swithced /Y /M what they mean?    

I can google it, but wanted to hear from Expert..

I also need a trick to search if the files in a folder ( the input files from customer) are sitting in the folder for greater than say 20 minutes..

Sorry ifI increased the scope of the request.

 

by: dragon-itPosted on 2009-09-27 at 22:38:45ID: 25436887

Sure.  The xcopy switches /Y mean overwrite without prompting so if the file already exists in the destination area then it will still copy.

The /m bit only copies files with the A archive bit set - when you modify a file it is flagged as needing a backup by the os so that you can just backup changed files you can see this in the proprteies of a file in explorer or using the command attrib.exe in a cmd window.

The /M switch only copies files that have this archive bit set and then resets it .... so if the file has changed since the script last ran the find command will see 1 files copied.  If the file hasn't changed it will se 0 files copied.

The find command returns an erorlevel result based on what you are trying to find and the script checks this and ou can act on it to use whatever alert you want...

The xcopy f| bit sends the letter f into the input of the xcopy command to stop it waiting for an answer to the Q 'is xxxx a file or directory'.

As to your other Q I suggest you raise a new related Q using the button on this Q and then it can be kept separate but those on this Q already will get notified of it.

Steve

Steve

 

by: sitaparijatPosted on 2009-09-28 at 00:03:21ID: 25437196

Hi Steve,
Your script expects me to save the earlier version to a folder and next time when you check see if it has changed or not.
There is one challenge with this script you have provided. I have a number of EDIs running and I need to check so I need to set up a different folder for each check.
. So If possible I  prefer some mechanism that can check the time stamp (last modified date )  of the file to ensure that it is older than say 20 minutes.

I want to check for a large number of files in a single script. I may have manylog directories with the log files. I want to repeat like below.

@echo off
set logfile1="C:\dir1\yourlogfile1.txt"
set logfile2="C:\dir1\yourlogfile2.txt"

echo f|xcopy /Y /M %logfile1% "%temp%\logfile1.txt" | find "0 File(s) copied"
if "%errorlevel%"=="0" (
 echo The file has not changed since the script was last ran
 dir %logfile% > bodyofemail.txt
 rem Use BLAT or whatever to send message
)
echo f|xcopy /Y /M %logfile2% "%temp%\logfile2.txt" | find "0 File(s) copied"
if "%errorlevel%"=="0" (
 echo The file has not changed since the script was last ran
 dir %logfile2% > bodyofemail.txt
 rem Use BLAT or whatever to send message
)


Any smarter way to do it?
 

 

by: dragon-itPosted on 2009-09-28 at 01:11:44ID: 25437448

Fair enough.  We could instead do a DIR of the file to see if it has an A attribute and then reset it and split the check off into a subroutine, i.e. something like this.  Also keeps a logfile of all the checks it does .. if you want it.  Have written this quickly so apologise if any typos, post if any issues.

If you reall want to check the file time stamps I imagine that is the route BillDL was going to go down -- you can trim and adjust the time stamps so you end up with a number effectively, though it is not quite a simple as it seems , i.e taking 2300 - 2245 as being 15 mins ago of course since that would give you "55" as an answer.  You could take 2300-2245 + 40 to give you a "right" answer but then 2310 - 2155 is 155... I suppose that doesn't matter as it is still > 20 mins that shouls trigger.... SO as long as it doesn't run within 30 mins of midnight then you could get away with:

timenow hhmm - timeonfile hhmm + 40

Have quick dirty test script at the bottm if you want to play around with it:

@Echo off
set errors=
set logfile="logfile.txt"
call :check "%temp%\logfile1.txt"
call :check "%temp%\logfile2.txt"
REM Add any more checks passing the filename of the logfile as above
call :sendemail %error%
exit /b

:check
REM Do a dir of the files of this name passed that have the archive attribute set
set thiserror=
echo Checking %~1 Attr: %~a1 Date: %~t1 Size: %~z1 >>%logfile%
dir /AA /b "%~1"
if errorlevel 1 set thiserror=%~nx1%
attrib -A "%~1"
if NOT "%thiserror%"=="" set error=%error% %thiserror%
exit /b

:sendemail %1
REM Send email using
set subject=Errors with EDI processes - %~1
If "%~1"=="" set subject=NO errors with EDI processes
REM send the email
exit /b

You can add  >NUL 2>&1 to the end of the dir and attrib lines once you are happy it is working -- you should either see "logfile1.txt" or "file not found" from the dir command.

Steve

@echo off
set now=%time:~0,5%
set now=%now::=%
set now=%now: =%
echo Started comparing times with %time% which is %now%
call :checkold x.txt
exit /b

:checkold
REM Set tstamp variable, remove spaces and colons and then take last 4 digits which is hhmm. Doesn't matter if it 8:36 or 08:36
set tstamp=%~t1
set tstamp=%tstamp::=%
set tstamp=%tstamp: =%
set tstamp=%tstamp:~-4%
set /A age=%now%-%tstamp%+40
echo Working on file "%~1" date stamp %~t1 which is %now% - %tstamp% = %age%

 

by: BillDLPosted on 2009-09-28 at 10:30:57ID: 25441322

Hi Steve

I've had to problems with subtracting time values.  I haven't been able to spend much time since I wrote what I believed to be a working batch file though.  Preliminary tests indicated that it was working, but the flaws kept showing up when subtracting backwards past that 00:00 or 24:00 annoying "midnight hour" when the earlier time of just before midnight has the higher "number" that the current time in the "wee hours", and so ends up a negative integer.

I have attempted to address this using various conversions to numeric formats, adding 12 if PM to set value to 24-hr clock, etc, but it's still failing and I honestly don't have the time to look too much more deeply into it.

I am attaching it as a .TXT file rather than into a code snippet, because it's heavily remarked out for my own reference while trying to troubleshoot it, and it is lengthy.  This is the last attempt in which I tried your +40 thing (although I have to confess that I don't fully understand what it was designed to do.

It relies upon the following being true to even run though.
System %TIME% at Command Prompt ie. 24-hr clock =  13:59:30.86
System %TIME% at Command Prompt: Mon 09/28/2009
The following command:
dir /a-d /od /tw /4 testfile.doc | find /i "/"
generating this output:
09/28/2009  04:03 PM            34,816 testfile.doc

Perhaps you may see where the problem is.

  • IS-OLDER.txt
    • 7 KB

    Batch file that isn't working perfectly but worth a look. Change extension to .CMD

 

by: BillDLPosted on 2009-09-28 at 10:33:45ID: 25441340

Whoops, sorry, that was the version WITHOUT the +40 bit being used with the set /a command.  Makes not difference, it has flaws just the same.

 

by: QlemoPosted on 2009-09-28 at 10:36:01ID: 25441358

Sorry folks, but I do not get why we are running the long and winded way? Wouldn't the simple "Archive attribute check" method work?

 

by: BillDLPosted on 2009-09-28 at 10:53:25ID: 25441493

Yes, it would be, but sitaparijat did ask for a "time" solution in his comment http:#25437196 where possible.
"So If possible I  prefer some mechanism that can check the time stamp (last modified date )  of the file to ensure that it is older than say 20 minutes."

I tried and failed (a demonstration of my inexperience), but I'm sure you'll crack it in a couple of minutes ;-)

 

by: dragon-itPosted on 2009-09-28 at 11:30:20ID: 25441868

 

by: QlemoPosted on 2009-09-28 at 11:32:39ID: 25441888

I have understood that as using time stamps opposed to the copy-previous-files-to-compare-if-newer method, not necessarily really using the timestamp. I still think the Archive attribute method is sufficient.

 

by: QlemoPosted on 2009-09-28 at 11:38:14ID: 25441956

... and the same applies to the other question, as this technique could be used there, too. Only reason to go for a more complicated solution is if you want to evaluate the time stamp, eg. for escalation (20 minutes, 40 minutes, 60 minutes ago ...).

 

by: dragon-itPosted on 2009-09-28 at 11:46:51ID: 25442052

I didn't suggest this method for the other Q as obviously running two checks with attribute clearing possibly running differently might not be a good plan as they cancel each other out... it souns like diffrent files though -- one to check if the process has failed and not updating log files and one to check if any input files are over 20 mins old.  As you say they could be done in the same way with attribs too I guess having though of it more.  I didn't want to cloud this question with two tracks.  Clearly "modalot" has decided the other question isn't worthy anyway.

I don't know why I waste my time here for a few lousy T-shirts... I like the challenge and learning experiences but so easy to get put off... and I suppose the t-shirts do come in useful for the kids to have their hair cut in.

 

by: dragon-itPosted on 2009-09-28 at 11:48:08ID: 25442071

Anyway I've put far too much time into this Q and EE in general today already so I will leave sitaparijat with you lot and might come back if I see something interesting another day..

 

by: sitaparijatPosted on 2009-09-30 at 01:28:08ID: 31633343

The solutions have met my need. I have created another question for which is being discussed which will solve both the issues that I have.

Appreciate the patience of all the Gurus.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...