Solved

Location of desktop directory

Posted on 2004-08-26
10
308 Views
Last Modified: 2010-05-18
I'm writing a script for a marketing CD to drop a .lnk file on the desktop on a users request.  Unfortunatlely I can't exactly remember where the desktop directory is in Win98/95/ME.  I think it's C:\windows\desktop.  We would like to install this for "all users" on that machine.  Any help would be appreciated.

...Joel
0
Comment
Question by:techsolgroupnj
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 5

Expert Comment

by:Luniz2k1
Comment Utility
Your script could be configured to copy the .lnk file to C:\%windir%\desktop\
0
 

Author Comment

by:techsolgroupnj
Comment Utility
For these operating systems 95/98/ME... C:\%windir%\desktop\ is the "All Users" desktop? ...For lack of a better term.  I appreciate the quick response.
0
 
LVL 2

Expert Comment

by:MarinusVD
Comment Utility
for the current user I am not sure if %userprofile%\Desktop works on 98 or Me but might be worth checking.
0
 
LVL 6

Expert Comment

by:salvagbf
Comment Utility
Actually, I think you can create an All Users folder in the windows folder and then create a desktop folder in there and be guarenteed that any user who logs in will get the link.  Some installs of Win9x have a profiles folder and then individual user folders in there.

I only mention creating an All Users folder because I was cleaning a machine of spyware and didn't even realize that Win98 used an all users folder until I checked in there and saw that the stupid spyware was actually loading from c:\windows\all users\start menu\programs\startup.  The one place I didn't check!

It's worth a shot.
0
 
LVL 20

Accepted Solution

by:
DVation191 earned 150 total points
Comment Utility
a batch file like this should work...

IF EXIST "%SYSTEMDRIVE%\Documents and Settings" COPY "Shortcut.lnk" "%ALLUSERSPROFILE%\Desktop\
ELSE COPY "Shortcut.lnk" %WINDIR%\Desktop\

didn't test it...but i think that should be sufficient
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 5

Expert Comment

by:Luniz2k1
Comment Utility
Just so you know, "Documents and Settings" is only a directory of Windows 2000/XP/2003
For Win95/95/ME computers not using user profiles, the path is C:\%windir%\desktop\
0
 
LVL 20

Expert Comment

by:DVation191
Comment Utility
if the docs and settings folder doesn't exist, then its not a 2000/xp machine, so the batch runs the 'else' which puts it in the c:\windows\desktop
so it tests for OS and installs the shortcut appropriately
0
 
LVL 5

Expert Comment

by:Luniz2k1
Comment Utility
Exactly
0
 

Author Comment

by:techsolgroupnj
Comment Utility
Thanks to everyone for your help on this.  The script works great.
0
 
LVL 20

Expert Comment

by:DVation191
Comment Utility
you are very welcome. glad it works.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now