?
Solved

How can I copy a file to the start up folder of the start menu in win xp using a batch script?

Posted on 2009-04-15
5
Medium Priority
?
261 Views
Last Modified: 2013-11-09
What I want is to copy a file to the startup folde in the start menu using a batch script. The problem is that the location of the start menu folder depends on the current user logged on, so I guess i have to use a environment varioable of some sort similiar to e.g. %desktop%.
I'm using xcopy to do the copying.
0
Comment
Question by:Suppai
[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
5 Comments
 
LVL 85

Assisted Solution

by:oBdA
oBdA earned 600 total points
ID: 24145901
The variable to use is normally
%UserProfile%\Desktop

The following will retrieve the current desktop folder on XP even if this folder is redirected through a group policy:

for /f "tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" ^| find /i "Desktop"') do set DesktopFolder=%%b
echo User's desktop folder: %DesktopFolder%
0
 

Author Comment

by:Suppai
ID: 24145925
I actually asked for the location of the start menu folder of the user logged on and not the desktop.
Ive googled it a bit and found that this might work, but havent got the chance to test it yet.Is this the location I'm looking for?

"C:\Documents and Settings\%USERNAME%\Start Menu\Programs\Startup\"
0
 
LVL 21

Accepted Solution

by:
JBlond earned 900 total points
ID: 24145964
Yes, but you can also use %USERPROFILE%\Start Menu\Programs\Startup.

Besides that, if you're using a Windows 2003 network with at least one Vista workstation, you could also use Group Policy Preferences for this.
http://www.microsoft.com/downloads/details.aspx?FamilyID=42E30E3F-6F01-4610-9D6E-F6E0FB7A0790&displaylang=en
0
 
LVL 6

Expert Comment

by:Justin_W_Chandler
ID: 24158834
WHY am I missing out on several question? Are they not getting posted to the Windows Batch zone?? oBdA, do you know what zone this question was posted in originally?

Justin Chandler
0
 
LVL 85

Expert Comment

by:oBdA
ID: 24158875
Must have been Windows Batch Scripting, it's the only one of the three above I actively monitor.
0

Featured Post

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

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

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will learn how to count occurrences of each item in an array.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses

765 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