Create Folder Shortcut via a batch file

Hi

We have a Windows XP machine that is used in our Board Room for presentations. I get our users to login to that machine as themselves. I would like to create a batch file which creates a files and folder shortcut on the desktop which will allow the logged in user to see their files on our server when they log into that XP machine. How can this be done?

Thanks for the help!!
sagarhAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

julian_bruntCommented:
Never done it with a BATCH file and looking around it seems there are no resources to help either, but it can be done easily with VBS.  Take a look at this example here.....
http://www.computerperformance.co.uk/ezine/ezine119.htm

And for 'Special folders' (for example things like %userprofilepath% in dos) see here:
http://technet.microsoft.com/en-us/library/ee156616.aspx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mino DCCommented:
First you have to create a small text file by the name mkshortcut.vbs. Use your favorite text editor to edit the file, even notepad will do. Then copy the following text and paste it into the file:
 
set WshShell = WScript.CreateObject("WScript.Shell" )
 set oShellLink = WshShell.CreateShortcut(Wscript.Arguments.Named("shortcut") & ".lnk")
 oShellLink.TargetPath = Wscript.Arguments.Named("target")
 oShellLink.WindowStyle = 1
 oShellLink.Save
 
Then save the file and exit the editor. Make sure that you move the file in a directory in your PATH (usually C:\WINDOWS\System32 is fine). Now, from the command line you can create shortcuts this way:
 
mkshortcut /target:TargetName /shortcut:ShortcutName
 
You will have to replace TargetName with the name of the target file and ShortcutName with the name of the shortcut to be created (do not include a .lnk extension!). For example:
 
C:\>mkshortcut /target:"c:/documents and settings/giannis/desktop" /shortcut:"My Desktop"
 
C:\>dir *.lnk
 Volume in drive C has no label.
 Volume Serial Number is 70FC-EBB4
 
Directory of C:\
 
12/03/2008  11:12 AM               453 My Desktop.lnk
 1 File(s)            453 bytes
 0 Dir(s)  46,659,989,504 bytes free
 
C:\>
 
Make sure that in target you include the full path of the target file name, starting with the drive letter and going down. For some reason Windows seem unable to create shortcuts with a relative path. Always use absolute paths for target.

http://www.giannistsakiris.com/index.php/2008/12/03/how-to-create-shortcuts-in-windows-from-the-command-line/
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Legacy OS

From novice to tech pro — start learning today.