Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Running script at logon

Posted on 2004-04-09
7
Medium Priority
?
319 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 200 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
Learn about cloud computing and its benefits for small business owners.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

618 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