Solved

Running script at logon

Posted on 2004-04-09
7
296 Views
Last Modified: 2010-04-19
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
0
Comment
Question by:goldrhim
  • 4
  • 2
7 Comments
 
LVL 11

Expert Comment

by:kabaam
ID: 10791345
Hi goldrhim,
give this one a shot... I think it should do the trick

%userprofile%/desktop

happy trails
Chad
0
 

Author Comment

by:goldrhim
ID: 10791378
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
 
LVL 11

Expert Comment

by:kabaam
ID: 10791459
to test it... you can run it from the run command of the users computer.  It should open expolorer with the correct folder.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:goldrhim
ID: 10791554
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
 
LVL 6

Accepted Solution

by:
archerslo earned 50 total points
ID: 10795930
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
 
LVL 11

Expert Comment

by:kabaam
ID: 10798058
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
 
LVL 11

Expert Comment

by:kabaam
ID: 10798107
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

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've always wanted to allow a user to have a printer no matter where they login. The steps below will show you how to achieve just that. In this Article I'll show how to deploy printers automatically with group policy and then using security fil…
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question