Re: Copying files based on date during logon

From: Al Dunbar [MS-MVP] (alan-no-drub-spam_at_hotmail.com)
Date: 02/27/05


Date: Sun, 27 Feb 2005 11:17:57 -0700


"Bob Williamson" <BobWilliamson@discussions.microsoft.com> wrote in message
news:3AAE34AB-9985-4791-9C30-B41282F38FB0@microsoft.com...
> Answers like that bring me back to the old days of ftp, gpoher, sellgin
stuff
> via nntp groups, etc and is why I continue to use NNTP groups, as opposed
to
> ones hosted on websites.
>
> I thank you for your time, you have been a great help. I think I will
learn
> some VBS...for myself if nothing else. (I used to program some in 6502
> machine language....long ago it seems...)

If you have ever been able to code in 6502, then I doubt you will have
difficulty with vbscript, which is somewhat less limiting!

> Thanks again,

You're welcome.

/Al

> Bob
>
> "Al Dunbar [MS-MVP]" wrote:
>
> >
> > "Bob Williamson" <BobWilliamson@discussions.microsoft.com> wrote in
message
> > news:890A700D-7986-446B-A617-539B1A776F22@microsoft.com...
> > > I guess my use of hte word "hack" was to try and make it obvious how
> > clueless
> > > I am with regard to scripting.
> >
> > LOL. Most of us will have deduced more about your scripting acumen from
your
> > actual code than from your self deprecating comments.
> >
> > > I thought I tried the redirect copy from the DFs location, but wil try
it
> > > again.
> >
> > Pardon? Your code looks like it would work, and you even said it did.
> >
> > > In a more general vein, would it be worth my while to learn VBscript,
for
> > > admin purposes? I know that is a very general question, but I
seriously
> > am
> > > not sure what would be best to expand on my current skill set.
> >
> > IMHO, an admin scripter cannot possibly get along without a reasonable
> > grounding in batch scripting. Batch is more hands-on with the o/s than
> > WSH/vbscript, or closer to the ground, if you will. A large proportion
of
> > the available commands are oriented more to the system than to
programming.
> > Historically, the programming aspects (GOTO, then CALL, then FOR) have
been
> > added over time as afterthoughts as it became evident that one could not
be
> > expected to type DOS commands all day long.
> >
> > VBScript is the exact opposite - a general purpose programming
environment
> > with o/s interface functionality added as an afterthought. It has NO
> > statements or commands that operate *directly* on the underlying
computer
> > environment. In fact, the ONLY "vbscript" functionality that opens the
door
> > to this access is the COM object interface, and the available COM
objects
> > such as the File System Object. Of course, this is not even native to
> > vbscript itself, but only to WSH.
> >
> > To answer your question as to whether it would be worth your while to
learn
> > VBScript, the answer is a resounding "IT DEPENDS!". Personally, I would
tend
> > to encourage you to do so. But I have found that not everyone takes to
it
> > equally. The same could be said of batch, of course, but even the least
> > adept of us are usually able to cobble together a simple batch file that
is
> > at least somewhat useful. The effort required to do very simple things
in
> > VBScript is great enough that one needs to actually work on it.
> >
> >
> > /Al
> >
> > >
> > > Thanks,
> > > Bob
> > >
> > > "Al Dunbar [MS-MVP]" wrote:
> > >
> > > >
> > > > "Bob Williamson" <BobWilliamson@discussions.microsoft.com> wrote in
> > message
> > > > news:A6555B99-6E1B-498B-8A2A-5F378031DD1C@microsoft.com...
> > > > > I guess a more general question would be, should I stick with my
use
> > of
> > > > > Xcopy? OR Should I be looking at going towards a more advanced
> > VBscript
> > > > etc?
> > > > >
> > > > > To me the use of xcopy seems like a hack, although it does work.
Here
> > is
> > > > an
> > > > > example of it's use:
> > > > >
> > > > > Net use q: dfs path
> > > > > Xcopy "q:\Microsoft
office\office10\OutlookSPPSCommon\vbaproject.otm"
> > > > > "%userprofile%\application data\Microsoft\Outlook" /S /D /Y /q
> > > > > Net use Q: /delete
> > > >
> > > > I don't understand your use of the term "hack". For some simple
> > operations,
> > > > a good batch solution can be every bit as reliable and elegant as a
> > vbscript
> > > > one. And, although vbscript gives you greater capability to apply
more
> > > > detailed logic, that does not mean that there are no vbscripts out
there
> > > > that are worse "hacks" than your sample script above.
> > > >
> > > > That said, the best choice for specific tasks within a logon
script/GPO
> > > > environment is the one that is simplest to maintain. If most of it
is
> > batch,
> > > > keeping it all in batch may be a consideration. If a significant
portion
> > is
> > > > in vbscript because it is just too hard to do in batch, it might be
> > worth
> > > > considering converting it all to vbscript. But that, in itself,
should
> > NOT
> > > > be the primary design goal.
> > > >
> > > > There are a few things you could do to simplify your batch script,
> > assuming
> > > > all of your clients are 2k or xp (not sure about nt):
> > > >
> > > > pushd "\\dfsServer\dfsShare$\Microsoft
> > > > office\office10\OutlookSPPSCommon"
> > > > Xcopy vbaproject.otm "%userprofile%\application
> > > > data\Microsoft\Outlook" /S /D /Y /q
> > > > popd
> > > >
> > > > or:
> > > >
> > > > Xcopy "\\dfsServer\dfsShare$\Microsoft
> > > > office\office10\OutlookSPPSCommon\vbaproject.otm"
> > "%userprofile%\application
> > > > data\Microsoft\Outlook" /S /D /Y /q
> > > >
> > > > Both methods will avoid the problem of drive Q: not being available.
> > > >
> > > > /Al
> > > >
> > > > > Thanks for your reply,
> > > > > Bob
> > > > >
> > > > > "Torgeir Bakken (MVP)" wrote:
> > > > >
> > > > > > Roland Hall wrote:
> > > > > >
> > > > > > > "Bob Williamson" wrote in message
> > > > > > > news:88B5A08F-98B5-4CB0-B1BC-9E9B3CA365C9@microsoft.com...
> > > > > > > :I am a scripting neophte, to put it in a nice fashion...
> > > > > > > :
> > > > > > > : In short, I have a batch file that is called via GPO during
the
> > > > logon
> > > > > > > : process called logon.bat. As part of that batch it calls
xcopy,
> > > > with some
> > > > > > > : command line options, which copies a file from a network
> > location to
> > > > the
> > > > > > > : local computer if the network file has a newer date. I am
QUITE
> > > > certain
> > > > > > > : there is a better way to do this.....and thus my post.
> > > > > > >
> > > > > > > You want to change what works?
> > > > > > >
> > > > > > > : I also need to register a dll after the copy occurs.
> > > > > > > :
> > > > > > > : Any tips on how best to handle this? I can probably get by
with
> > the
> > > > batch
> > > > > > > : file fo now, but I have to learn some mroe advanced
scripting
> > soon!
> > > > > > >
> > > > > > > Put it at the end of the batch file.
> > > > > > >
> > > > > > > regsvr32 filename.dll
> > > > > >
> > > > > >
> > > > > > And to make it unattended:
> > > > > >
> > > > > > regsvr32.exe /s filename.dll
> > > > > >
> > > > > >
> > > > > > --
> > > > > > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> > > > > > Administration scripting examples and an ONLINE version of
> > > > > > the 1328 page Scripting Guide:
> > > > > > http://www.microsoft.com/technet/scriptcenter/default.mspx
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >



Relevant Pages

  • Re: Copying files based on date during logon
    ... Most of us will have deduced more about your scripting acumen from your ... Batch is more hands-on with the o/s than ... VBScript is the exact opposite - a general purpose programming environment ...
    (microsoft.public.windows.server.scripting)
  • Re: Copying files based on date during logon
    ... I guess my use of hte word "hack" was to try and make it obvious how clueless ... I am with regard to scripting. ... OR Should I be looking at going towards a more advanced VBscript ... If most of it is batch, ...
    (microsoft.public.windows.server.scripting)
  • Re: Copying files based on date during logon
    ... via nntp groups, etc and is why I continue to use NNTP groups, as opposed to ... > the available commands are oriented more to the system than to programming. ... > VBScript is the exact opposite - a general purpose programming environment ... The same could be said of batch, of course, but even the least ...
    (microsoft.public.windows.server.scripting)
  • Re: Whis is better
    ... DOS scripting: simple but limited, great for scripting anything that you ... could otherwise type from the command line (batch files), ... this alongside VBscript as I'm sure microsoft will start flogging this as ...
    (microsoft.public.windows.server.scripting)
  • Re: Is VbScript to be discontinued by Microsoft
    ... converted to batch than to powershell, ... likely be better in powershell. ... There was a time when vbscript was envisioned as a ... You'd think vbscript would win in this area because it runs on more windows ...
    (microsoft.public.scripting.vbscript)