?
Solved

Why does the shortcut break

Posted on 2004-09-08
1
Medium Priority
?
303 Views
Last Modified: 2012-08-13
I have a batch file that maps 2 network drives, 4 printers and then creates a shortcut on the desktop.

The problem I'm having is:
Whenever a user logs on the script adds a duplicate shortcut (so there are two shortcuts to the program) both shortcuts will pull the program up but the user will get an error message.  To fix this problem, I have to go to the computer delete both shortcuts and remake the shortcut manually.  The program is on the mapped drive "M"

Here is a copy of the script I'm running:

net use f: \\server\apps
net use M: \\server\metro
shortcut.exe /a:c /f:"%USERPROFILE\Desktop\MetroScan.lnk" /t:f:\METRO\WINDOWS\WINMETRO.EXE
rundll32 printui.dll,PrintUIEntry /u /in /n \\ELDORADO-BDC\Kyocera3800
rundll32 printui.dll,PrintUIEntry /u /in /n \\ELDORADO-BDC\Ricoh Copier
rundll32 printui.dll,PrintUIEntry /u /in /n \\SERVER\Kyocera9100
rundll32 printui.dll,PrintUIEntry /u /y /in /n \\SERVER\Suite200


thanks
0
Comment
Question by:Sglennlmb
[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
1 Comment
 
LVL 5

Accepted Solution

by:
jmacmicking earned 500 total points
ID: 12009301
How about just IF EXIST in the batch file to check to see if the link exists before creating it? For instance:

net use f: \\server\apps
net use M: \\server\metro
IF EXIST "%USERPROFILE\Desktop\MetroScan.lnk" GOTO AssignPrinters

shortcut.exe /a:c /f:"%USERPROFILE\Desktop\MetroScan.lnk" /t:f:\METRO\WINDOWS\WINMETRO.EXE

:AssignPrinters
rundll32 printui.dll,PrintUIEntry /u /in /n \\ELDORADO-BDC\Kyocera3800
rundll32 printui.dll,PrintUIEntry /u /in /n \\ELDORADO-BDC\Ricoh Copier
rundll32 printui.dll,PrintUIEntry /u /in /n \\SERVER\Kyocera9100
rundll32 printui.dll,PrintUIEntry /u /y /in /n \\SERVER\Suite200
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Make the most of your online learning experience.
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…
Progress

771 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