Solved

Windows 7 Users Start Menu shortcut

Posted on 2013-05-17
8
655 Views
Last Modified: 2013-09-12
How we can add program shortcut to "Windows 7 Users Start Menu shortcut" ?

previously in windows xp for domain users we are using user domain logon script to copy shortcuts

rem  ::: copy shortcut to Windows xp Users Start Menu using batch script :::

copy "\\testserver\user_shortcuts\*.*"  "%USERPROFILE%\Start Menu\"  /y


now this is not working with windows 7 pc for domain users of windows 2003.


Kindly suggest.
0
Comment
Question by:mash1978
  • 3
  • 3
  • 2
8 Comments
 
LVL 19

Expert Comment

by:n2fc
Comment Utility
For windows 7 change

%USERPROFILE%\Start Menu\

to

%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu
0
 
LVL 68

Assisted Solution

by:Qlemo
Qlemo earned 300 total points
Comment Utility
Better to use %APPDATA% ("%AppData%\Microsoft\Windows\Start Menu\"), but that requires to check for the OS. One way to do that is:
if "%LocalAppData%" == "" (set base=%UserProfile\Start Menu) else (set base=%AppData%\Microsoft\Start Menu)
copy "\\testserver\user_shortcuts\*.*"  "%base%\"  /y

Open in new window

0
 
LVL 19

Expert Comment

by:n2fc
Comment Utility
Qlemo forgot "Windows" in code sample path...


Should be:
if "%LocalAppData%" == "" (set base=%UserProfile\Start Menu) else (set base=%AppData%\Microsoft\Windows\Start Menu)

Open in new window

0
 
LVL 68

Expert Comment

by:Qlemo
Comment Utility
Oops.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 19

Expert Comment

by:n2fc
Comment Utility
No problem :-)
0
 

Accepted Solution

by:
mash1978 earned 0 total points
Comment Utility
Hi,

it giving me below error message:

Access is denied.

-----------------------------------------

C:\>STartmenu_copy.bat

C:\>if "C:\Users\MK\AppData\Local" == "" (set base=AppData\Microsoft\Windows\Sta
rt Menu )

C:\>copy "c:\user_shortcuts\*.*"  "\"  /y
c:\user_shortcuts\Microsoft Office Word 2007.lnk
Access is denied.
c:\user_shortcuts\TEST_SHORTCUTS.txt
Access is denied.
        0 file(s) copied.
C:\>
---------------------------------------------------------------

if used command prompt with run as administrator then result is :

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>cd\

C:\>STartmenu_copy.bat

C:\>if "C:\Users\MK\AppData\Local" == "" (set base=AppData\Microsoft\Windows\Sta
rt Menu )

C:\>copy "c:\user_shortcuts\*.*"  "\"  /y
c:\user_shortcuts\Microsoft Office Word 2007.lnk
c:\user_shortcuts\TEST_SHORTCUTS.txt
        2 file(s) copied.
C:\>
--------------------------------------------------------------------------

but not showing shortcuts to users start menu

even searched c:\user folder but files not found
0
 
LVL 68

Assisted Solution

by:Qlemo
Qlemo earned 300 total points
Comment Utility
There was a percent sign missing (typo), and so %base% was not set. If you look at the echoed copy command, you'll see it is trying to copy it to "\" - the root folder of the current drive.
if "%LocalAppData%" == "" (set base=%UserProfile%\Start Menu) else (set base=%AppData%\Microsoft\Windows\Start Menu)
copy "\\testserver\user_shortcuts\*.*"  "%base%\"  /y

Open in new window

0
 

Author Closing Comment

by:mash1978
Comment Utility
We can add script in user login script.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

743 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

17 Experts available now in Live!

Get 1:1 Help Now