The easiest way to do it would be to create the shortcut manually and then copy the shortcut file via batch file from a network share.
copy \\server\share\shortcut.lnk %userprofile%\desktop
I saw a way to actually create the .lnk file from a batch file once, but it seemed pretty convoluted to me. I may be able to find it if you absolutely have to do it this way.
atojaf - I'm not sure I am following. Let me try to clarify what I meant.
You should be able to create a shortcut, which points to c:\csh\csh.exe, on a desktop manually as Roger explained above. Then copy and paste that shortcut to a shared network location. Then use a batch file to copy the .lnk file back down. It will maintain the pointers to your c:\csh\csh.exe file that you specified when you originally created it. You can use a batch file to copy that link back down to other desktops:
I want to create a batch file so that when our users needs this icon on their desktop, I can just tell them to execute this file from their net drive- part of this batch also install create a Windows folder on their C: drive and to create a Win.ini file- chipk I had done what you suggested - create a batch to copy the .lnk file back to the desk- but for some reason it doesn't work sometimes.
That's chipk. I just realized what I was doing wrong on my batch file. I wasn't putting the path - C:\documents and settings - on quotes. Your last suggestions works. Now if I could just find a way to create a batch file that will enter a line of code on the Win.ini in XP, I will be done with this task. anyway, thanks again for the help.
Glad that worked out for you. If you don't need the entry at a specific place in the win.ini file, that should be doable.
The echo command used in conjunction with double redirects (>>) will append lines to your INI file, and any ascii file, for that matter. Emphasis because a single redirect overwrites an entire file. For instance:
echo "New Entry" >> %systemroot%\win.ini
Will create a new line that simply says "New Entry" in the win.ini file. Now, I'd make a copy of your win.ini file before doing this just to be safe.
If you need the entry like halfway down the file, though, that's a little tricky, and may require a third party tool. This is generally a lot easier on Unix.
I know some basic Unix commands. You're right, the line of code that I want to append to the win.ini file seem to be attaching itself to the end of entries already on the file. I wish windows has sed or grep type of utility . or omething. thanks .you helped me a lot.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.