Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logon script to copy font files to a user machine 2

Status
Not open for further replies.

BSmith2518

Programmer
Jul 17, 2001
13
0
0
US
I am new to logon scripting. I need to have fonts copied to a user's maschine when they logon. I have tried to write a script like this

Copy Server\Share\Fonts C:\Windows\Fonts

The script does not work and it says that the file(s) can not be found.

The share folder is accessible to everyone.

Can someone help me write this script if it is possible.

Thanks
 
Try something like

@echo off

REM If we have already copied the files, don't do it again
if exist %SYSTEMROOT%\fonts_copied.tok goto end

echo ****************************************************
echo * *
echo * Copying Fonts to your hard drive... please wait! *
echo * *
echo ****************************************************

REM Map the network drive, copy the files, and disconnect
REM creating the token file in the process
net use Z: \\server\share > %SYSTEMROOT%\fonts_copied.tok
copy Z:\fonts\*.* %SYSTEMROOT%\fonts > %SYSTEMROOT%\fonts_copied.tok
net use /delete Z:

REM End of script
:end


Note I haven't tested this, and it will only work on WinNT/2K/XP, as Win9x doesn't have the %SYSTEMROOT% variable.

Hope it helps. [auto] MCSE NT4/W2K
 
Thanks alot but actually I need something that will work on Win 98
 
If it's ONLY for Win98, change %SYSTEMROOT% to %WINDIR%.

If you need it for both, let me know and I'll tweak the script to do OS checking as well :). [auto] MCSE NT4/W2K
 
Is there any Script to Copy a Application File to the Client at the Time of Logon. Only if the Client Application File's Date is Different from the File Available on Server.

Plz Help !!!
 
Yup, xcopy has the ability to do date/time checking built in.

Something like this... (thanks dl for the formatting :))

@echo off
echo ****************************************************
echo * *
echo * Checking for latest app version... please wait! *
echo * *
echo ****************************************************

REM No need to map the network drive under Win2K / NT - UNC path is fine
REM Copy files using the /d parameter to check dates
xcopy /d \\servername\sharename\filename.ext C:\localpath

:End


Now, the explanation - /d can be used 2 ways.
1. If you include a date (/d:m-d-y) it will only copy files changed on or after that date.
2. If the date is omitted (/d) then it will copy only those files whose source time is newer than the destination time.

Good Luck Cheers,
Sam

Please let members know if you found their posts helpful.
 
Thank OzDog !!!

It works fine, except if i have to revert back to old EXE file while using \d switch. if the Modified date is not equal (Doesnt Matter if the Server EXE is older than the One the client pc), it should copy else nothing.

Thanks again !!


 
Hi all,

I'm a newbie on writing script.
My main server is using NT4 but all the clients' PC are using W98, and I need to write a script that to run a program to check all of them when they login. The program will generate a file which will store under the same directory of the program file.

1. Do I need to copy the program into the NT4 server? (the program is currently stored under another server)
(such as \\central01\sys\admin\read.exe)

2. How to write a script like this? And what kind of file name should I save as? (The second question maybe too stupid to ask.. ^_^)

Thx all
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top