Batch File Not To Run Everyday

Hi,
I have a batch file which is to uninstall frminstal & install framepkg.exe.
I had placed in the server, so after my users login to domain , the batch file run on all computers.
But  I don't want the batch file to run everyday, may once a week. Is there a way ?
ktancl88Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mds-cosCommented:
Yes, there is.  You can do a comparison of the %date% variable so that the batch only runs on a specific day of the week.
0
popularbhaskarCommented:
you can schedule on the server
There is a command "at" from command prompt. using which you can schedule for a particular time.
0
mds-cosCommented:
The "at" is not going to work, because we are dealing with user logon scripts vs. a batch file scheduled to run on the server itself.
0
ktancl88Author Commented:
Dear mds-cos,

How does this %date% variable be added in to the batch file? How does it work?

Are you able to show me an example ?
0
mds-cosCommented:
Here is the simple way.  There are other ways, but I think this is proably the most straight-forward if you are using DOS level scripting.  I am using two scripts to very easily break apart the day and the date parts of the system variable %date%.

If you don't want to do this, dig into DOS scripting a bit.  There are other ways to accomplish the same thing.  And of course you could also move to vb script if you want a more powerful scripting language.


user.bat (or .cmd if you prefer)
----------------
rem  ! Main user login script !
.... Whatever else your login script does (time sync, drive mapping, printer mapping, etc.)

rem  script to uninstall frminstal & install framepkg.exe
call \\%loginserver%\netlogon\frameinstall.bat %date%

... Whatever additional you want your login script to do
---------------


frameinstall.bat (or .cmd if you prefer)
rem ! Script to uninstall frminstal & install framepkg.exe !
rem ! but only run every Friday                                       !

rem  if today is not friday exit the script
IF NOT "%1" == "Fri" goto :EOF

...your commands to uninstall frminstal
...your commands to install framepkg

:EOF  (this label is actually optional, since the :EOF label is now assumed by goto)




0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Anti-Virus Apps

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.