Running script at logon

Hi there!

I work for a small firm (part time) that has a file server running Server 2003 SBE.  I would like to run a script that would copy a file from a folder on the server to the user's desktop.  The problem is, there are (unfortunately) multiple operating systems that would connect to the network:  98, ME, XP Home, XP Pro.

Is there a standard variable that is the user's desktop (instead of C:\Windows\Desktop and C:\Documents and Settings...).

Sorry if this is a silly question!  I'm a student and still learning!

Thanks,
Tim
goldrhimAsked:
Who is Participating?
 
archersloConnect With a Mentor Commented:
As you suggested, this won't work since you're not using roaming profiles and you're using different OS versions.  However, you may want to consider simply copying the file into a particular folder, say "C:\Database\file.mdb", on each workstation, then simply put a shortcut on each Desktop that points to that location.  It's usually a better practice to use shortcuts on the Desktop rather than storing actual data files there anyway.

Archer
0
 
chadCommented:
Hi goldrhim,
give this one a shot... I think it should do the trick

%userprofile%/desktop

happy trails
Chad
0
 
goldrhimAuthor Commented:
Will this work even if the user profiles are local and not on the server?  Users only access the server to get files.

Thanks!
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
chadCommented:
to test it... you can run it from the run command of the users computer.  It should open expolorer with the correct folder.
0
 
goldrhimAuthor Commented:
Well, it seems to have worked for the XP computer that I'm on now, but the 98 machine, it just created a document called Desktop.  Here's my syntax

copy "E:\File_Database\File_Database.mdb"
"%userprofile%/Desktop"

If I use the syntax you gave me, I get an "invalid syntax" error.  If I use it without the quotes on the last portion, I get the same.
0
 
chadCommented:
You can have your script check for the version of windows before copying the file to desktop.
for example

if windows xp copy to ...
if win 98 copy to...
if win ME copy to...

that isn't actual code... just an idea on how it would work
0
 
chadCommented:
this is a copy of a batch file that will determine and display the version of windows you are running.
I got it from a post from Bartender_1, a great expert here at EE.  He says he got it from someone else.
You can edit it to remove the gotos and the echos if need be.  This is a semi clean way of showing how it works.
you can change the winxp section to read
copy filepath\name %userprofile%\desktop
and so on for the other OSs

@ECHO OFF
VER|FIND "XP">NUL
IF NOT ERRORLEVEL 1 GOTO WinXP
VER|FIND "2000">NUL
IF NOT ERRORLEVEL 1 GOTO Win2K
VER|FIND "NT">NUL
IF NOT ERRORLEVEL 1 GOTO WinNT
VER|FIND "Mil">NUL
IF NOT ERRORLEVEL 1 GOTO WinME
VER|FIND "98">NUL
IF NOT ERRORLEVEL 1 GOTO Win98
VER|FIND "95">NUL
IF NOT ERRORLEVEL 1 GOTO Win95
GOTO BADOS

:WinXP
ECHO WinXP
GOTO END

:Win2K
ECHO Win2K
GOTO END

:WinNT
ECHO WinNT
GOTO END

:WinME
ECHO WinME
GOTO END

:Win98
ECHO Win98
GOTO END

:Win95
ECHO Win95
GOTO END

:BADOS
ECHO This OS is not supported
GOTO END

:end

0
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.

All Courses

From novice to tech pro — start learning today.