[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Why does the shortcut break

Posted on 2004-09-08
1
Medium Priority
?
313 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
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
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 …
Six Sigma Control Plans

834 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