Create Shortcuts via DOS command - visual-studio

I would like to know if there is a DOS-Command in WinXP to create shortcuts (to an executable). I'm looking for DOS-Command if it is available, not a batch or script file (I'm only finding batch files and vbscipts when I search online).
Just to give you a background on what i'm doing, I would like Visual Studio 2005 to create a shortcut to the executable as part of the post-build event, and I was hoping to use a DOS-Command to do that.
Any help would be greatly appreciated. Thanks!

There is a command line shortcut tool which can create .lnk shortcut files that comes with (the very old) Microsoft Windows NT 4.0 Resource Kit Support Tools.
http://www.microsoft.com/downloads/details.aspx?FamilyID=3E972E9A-E08A-49A2-9D3A-C0519479E85A&displaylang=en
Here is a reference for the shortcut tool itself:
http://ss64.com/nt/shortcut.html
However, if you are doing this as part of an installation, you should probably look into using a standard installer which can create these shortcuts an a fashion that is easily uninstalled as well. Try this question as a start:
Create program installer in Visual Studio 2005?

batch files are files with DOS commands. If you're looking for DOS commands (and it takes more than a single step), then batch files are what you want.
If you want to use it in your post-build event, then a batch file will work just fine. Just type it in and it will work as if it were a DOS command.

You can specify a batch file and vbscript file as the command, and windows will just run the interpreter to execute your command as though it were a "DOS command"
Its not actually "DOS" anymore, it only looks like it.

Related

Unattended Installation of an EXE (Without user interaction)

Is there any scripting language available for creating Silent Installation (without giving input and clicking next, agree and finish)...? I want to do unattended installation of NewsGator.exe application in windows server, which scripting would be best..? Thanks in Advance for your reply.
NSIS provides the very simple /S flag for running installers.
It's also extremely easy to create a dead simple installer.
All the MSI installers can support silent installations supplying the input parameters thru the command line in the form of:
installer.exe /v/qn"PARAMETER=VALUE PARAMETER=VALUE"
try autoit, here is an example of how to automate a WinZip install :
http://www.autoitscript.com/autoit3/docs/tutorials/winzip/winzip.htm
I have used it to automate several installs in the company i work with, its pretty straight forward.

Creating a selfextracting executable which will copy itself to temp directory on Windows and launch itself

I want to distribute a setup in a self extracting executable form. I want to pack versions for 32 bit and 64 windows. So I have a program which first checks the version of Windows OS running and then launches the correct program. SO I have a directory structure like this
DetermineOS.exe
Win32\Win32Setup.exe
Win32\supporting win32 files
Win64\Win64Setup.exe
Win64\Supporting win64 files
I want to pack them in a bundle called something like install.exe. When the user clicks install.exe it will extract this directory structure to the temp location and launch DetermineOS.exe which will then launch the correct setup.exe
Will NSIS be the easiest way to go? Would this be a compicated NSIS script? Thanks.
It sounds to me that the only thing you want to get out of it is to extract to the %TEMP% location and run a certain exe file. If that's the case, I'm not sure NSIS is the easiest way to go. Most of the archives support self-extraction and running a command on extraction-complete. For instance, WinRAR and 7z have such modules. And my gut feeling is this option seems to be easier than NSIS.
Different bootstrappers also support this scenario. For instance, Visual Studio bootstrapper or dotNetInstaller. I've recently blogged about this simplest case with dotNetInstaller.
Hope this helps.
You could put the different images (executables) in the "root" image and extract and run the appropriate image as needed (many Sysinternals tools do this - e.g. the "root" application embedds the drivers for 32 and 64 bit).

Is it possible for a Perl script running on a Unix/Linux platform to create Windows Shortcuts?

If I want to create a *nix symlink, I'll call symlink();, if i'm running a script on windows and I want to create a shortcut, I'd use Win32::Shortcut.
But what if I want to create a Windows shortcut if running a script from a *nix machine?
I'm accessing a SMB share on a Windows Server 2003 machine from my *nix machine.
Well, I don't know if Samba provides an API for that. On the other hand, Windows shortcuts are just .lnk files in a specific format.
It's been a long time since the initial question, but I've had the same issue and found a solution.
I wrote an application whose goal is to allow anyone to create lnk files from any OS.
I started writting it in bash and then I converted it in C (the sources are available).
It's still fresh, so except me nobody tested yet, but you can have a look here :
http://www.mamachine.org/mslink/index.en.html

Automatically creating shortcuts on any Windows computer

I'd like to create some sort of script that will create a particular shortcut on the desktop of any Windows computer. The idea is to make the script available (to students in a course) so that they can download it to their computer and run it just by clicking it (i.e. not running it at the command-line). The script will have to check for some particular folders and files, and, if they exist, create the shortcut.
I'm a Linux guy and know very little about Windows, and so I am not even sure where to start to looking. I considered into using a Python script to do this, but that apparently requires installing some Windows-specific extensions, which I don't want to insist that that users do.
This can be done in VBScript, using the Windows Script Host which should be installed and usable on nearly any recent enough copy of Windows.
You want the CreateShortcut() method of the WshShell object which gets you an object representing a shortcut. You'd modify its properties and use its Save() method to actually create the shortcut file.
I've linked to the scripting guide at MSTN, as well as a page specific to the shell object. That should be a good starting point.
For this, I often work up a quick NSIS script and compile it to an EXE. The result is a very small executable. You can download NSIS itself at http://nsis.sourceforge.net/Download. I recommend HM NIS Edit to start with, as it has a wizard that builds a base script for you. Most of that wizard won't be applicable to your situation, but it is a good way to get started. Notepad++ also does syntax highlighting for NSIS.

Installation file names in Windows Vista

I read in this article:
http://technet.microsoft.com/en-us/library/cc709628.aspx
That Windows detects Installers through file names, following this tip, Is it better to include setup in the file name for the installer
I mean ProductSetup.msi is better than Product.msi???
It's hard to think that Windows does this kind of detection :-)
This only applies to EXE files. If you've got an MSI file, it's up to the MSI file to specify which parts of the MSI require elevation or not.
That's news to me, but it does seem like Windows Vista treats files differently when they have "setup" in their name. It will probably just prompt you for administrative rights up front if it detects that it's an installer, which is what you'd want.
Also worth reading is How User Account Control Affects Your Application, to ensure that your setup runs as administrator embed the correct manifest into the setup EXE. This way it doesn't matter (to Vista) what your installation is called.
That said however, if you expect the application to be installed on a terminal server then if your installer is called something like SETUP.EXE or INSTALL.EXE Terminal Server will automatically kick into "install mode". Should save you some headaches from those customers who don't know they should be in install mode first, or choose not to install via Add/Remove Programs (which also kicks install mode in automatically)

Resources