• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 160
  • Last Modified:

finding the windows directory in batch script

Howdy,

    I am writing a batch logon script for my windows 2000 server and windows 98 clients that will automatically copy a .lnk (shortcut) into the users startup directory. On my windows 2000/xp based systems this should be a simple task.

i.e.: copy \\server\cbldata\business\WPI529process.lnk C:\Documents and Settings\All Users\Start Menu\Programs\Startup

However,

On the windows 98 systems the startup directory is located under the windows directory. Some of my systems windows directories are named differently. i.e. c:\win or c:\win98 or even c:\windows. I am kind of familiar with canonalization and I was wondering is there is a way that i could use a copy command similiar to the one above to perform this same proceedure in windows 98 regardless of what the windows directory is called.

i.e.: copy \\server\cbldata\business\WPI529process.lnk c:\%SYSTEM%\Start Menu\Programs\StartUp


Any insight is appreciated,

Thanks!
0
sadian
Asked:
sadian
1 Solution
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
Actually, I believe you're looking for the "%windir%" variable.

copy \\server\cbldata\business\WPI529process.lnk c:\%windir%\Startm~1\Programs\StartUp
0
 
sadianAuthor Commented:
YAY! your awesome!

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now