Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Create .exe file from shortcut?
New Posts  All Forums:Forum Nav:

Create .exe file from shortcut?

post #1 of 27
Thread Starter 
Whats the best way to go about doing this? I don't want to use bat or shortcuts.
Big Daddy
(14 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7-4970k ASUS Z97-A 2 x EVGA GTX 980Ti Classified 32GB DDR3 1866MHz Corsair Dominators 
Hard DriveCoolingOSMonitor
2 x Samsung 1TB EVO SSD Corsair H80i Windows 10 x64 ASUS ROG Swift M 
KeyboardPowerCaseMouse
Vortex Pok3r Corsair 1200W Jonsbo UMX3 Mionix 
  hide details  
Reply
Big Daddy
(14 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7-4970k ASUS Z97-A 2 x EVGA GTX 980Ti Classified 32GB DDR3 1866MHz Corsair Dominators 
Hard DriveCoolingOSMonitor
2 x Samsung 1TB EVO SSD Corsair H80i Windows 10 x64 ASUS ROG Swift M 
KeyboardPowerCaseMouse
Vortex Pok3r Corsair 1200W Jonsbo UMX3 Mionix 
  hide details  
Reply
post #2 of 27
Kind of unclear on what you want? More of an explanation of what your doing/situation?
Title System
(14 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II X4 965 Gigabyte GA-MA785GMT-UD2H Sapphire HD 6850 1GB DDR3 Crucial Ballistix Tracers 4GB 
Hard DriveOptical DriveCoolingOS
Kingston SSD 64GB BENQ DVD-RW Custom W/C Kit Windows 7 Professional x64 
MonitorKeyboardPowerCase
24" LG LED Logitech Wave Corsair 700W Modular Coolmaster Half-X 
MouseAudio
Logitech MX Revolution 5.1 Surround / Studio Recording Headphones 
  hide details  
Reply
Title System
(14 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II X4 965 Gigabyte GA-MA785GMT-UD2H Sapphire HD 6850 1GB DDR3 Crucial Ballistix Tracers 4GB 
Hard DriveOptical DriveCoolingOS
Kingston SSD 64GB BENQ DVD-RW Custom W/C Kit Windows 7 Professional x64 
MonitorKeyboardPowerCase
24" LG LED Logitech Wave Corsair 700W Modular Coolmaster Half-X 
MouseAudio
Logitech MX Revolution 5.1 Surround / Studio Recording Headphones 
  hide details  
Reply
post #3 of 27
You want to make an .exe that executes another .exe?
Omicron Lyrae
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II X3 720 BE @3.6 Asus M4A785TD-V EVO Sapphire HD5770 V2 OCZ 2x2GB Gold DDR3-1333 
Hard DriveOptical DriveOSMonitor
Samsung Spinpoint F3 1TB Sony Lightscribe DVD-RW Windows 7 Professional 64-bit AOC F22+ 1080p 
KeyboardPowerCaseMouse
Cherry Scissor Switch Flat Keyboard OCZ StealthXstream 600W Cooler Master Elite 334 Microsoft Sidewinder 
  hide details  
Reply
Omicron Lyrae
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II X3 720 BE @3.6 Asus M4A785TD-V EVO Sapphire HD5770 V2 OCZ 2x2GB Gold DDR3-1333 
Hard DriveOptical DriveOSMonitor
Samsung Spinpoint F3 1TB Sony Lightscribe DVD-RW Windows 7 Professional 64-bit AOC F22+ 1080p 
KeyboardPowerCaseMouse
Cherry Scissor Switch Flat Keyboard OCZ StealthXstream 600W Cooler Master Elite 334 Microsoft Sidewinder 
  hide details  
Reply
post #4 of 27
Thread Starter 
Yes, basically right I have a .exe file which requires parameters such as -parameter1 -parameter2 -parameter3, etc, so I created a shortcut to this exe with the parameters in the target line, I would like to make a single .exe file with these parameters already included.
Big Daddy
(14 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7-4970k ASUS Z97-A 2 x EVGA GTX 980Ti Classified 32GB DDR3 1866MHz Corsair Dominators 
Hard DriveCoolingOSMonitor
2 x Samsung 1TB EVO SSD Corsair H80i Windows 10 x64 ASUS ROG Swift M 
KeyboardPowerCaseMouse
Vortex Pok3r Corsair 1200W Jonsbo UMX3 Mionix 
  hide details  
Reply
Big Daddy
(14 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7-4970k ASUS Z97-A 2 x EVGA GTX 980Ti Classified 32GB DDR3 1866MHz Corsair Dominators 
Hard DriveCoolingOSMonitor
2 x Samsung 1TB EVO SSD Corsair H80i Windows 10 x64 ASUS ROG Swift M 
KeyboardPowerCaseMouse
Vortex Pok3r Corsair 1200W Jonsbo UMX3 Mionix 
  hide details  
Reply
post #5 of 27
Paramters are passed INTO an executable, not contained within it.

The point of a parameter is to pass things at runtime, not compile time. Building an executable with the parameters built in is no different than just hard coding the options.

Edit - I assume you have an EXE that you didn't compile so you can't hard code things. You can write a whole other program to execute that file with parameters, but it would literally achieve the same thing that doing the shortcut method will.

I don't know the code off hand, but it would be an extremely simple program that you could write and compile using even BASIC.

I don't get the point.
Edited by _02 - 1/25/11 at 8:58am
    
CPUMotherboardGraphicsRAM
Phenom II X3 720 @ 3.5 (1.39v) Gigabyte GA-MA790XT-UD4P ASUS 5850 @ 880/1180 (1.118v) 4gb 1333mhz G.Skill DDR3 
Hard DriveHard DriveHard DriveHard Drive
64gb Crucial M4 SSD 3x 250gb WD2500JD - RAID0 1tb WD1001FALS 1tb WD10EARS 
Optical DriveCoolingOSMonitor
Pioneer DLDVD/CDRW Arctic Freezer Pro 64 Win 7 64bit Ultimate E2305 LG 23" LED 
KeyboardPowerCaseMouse
Filco Majestouch II Ninja Tenkeyless Fortron BlueStorm II 500w CM 690II Advanced Razer DeathAdder 
Mouse PadAudioAudio
generic Echo Miamidi PCI M-Audio BX5a Studio Monitors 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Phenom II X3 720 @ 3.5 (1.39v) Gigabyte GA-MA790XT-UD4P ASUS 5850 @ 880/1180 (1.118v) 4gb 1333mhz G.Skill DDR3 
Hard DriveHard DriveHard DriveHard Drive
64gb Crucial M4 SSD 3x 250gb WD2500JD - RAID0 1tb WD1001FALS 1tb WD10EARS 
Optical DriveCoolingOSMonitor
Pioneer DLDVD/CDRW Arctic Freezer Pro 64 Win 7 64bit Ultimate E2305 LG 23" LED 
KeyboardPowerCaseMouse
Filco Majestouch II Ninja Tenkeyless Fortron BlueStorm II 500w CM 690II Advanced Razer DeathAdder 
Mouse PadAudioAudio
generic Echo Miamidi PCI M-Audio BX5a Studio Monitors 
  hide details  
Reply
post #6 of 27
Thread Starter 
Quote:
Originally Posted by _02;12136841 
Paramters are passed INTO an executable, not contained within it.

The point of a parameter is to pass things at runtime, not compile time. Building an executable with the parameters built in is no different than not allowing parameters, and just hard coding the options.

Why do you need it to accept paramters, AND have the parameters built in?

Edit - I assume you have an EXE that you didn't compile. You can write a whole other program to execute that file with parameters, but it would literally achieve the same thing that doing the shortcut method will.

I don't get the point.

Maybe I should explain it better. Alright take this for example for srcds game servers.

There is a single file called hldsupdatetool.exe, now if I create a shortcut to it, add the following to the target line so it looks like so..

"C:\srcds\hldsupdatetool.exe" -command update -game tf -dir .

Everything from the -command to the period at the end is what I would want to build into a single .exe, so the file would launch as an executable, not a shortcut to an executable.

I know its possible as I have had someone do it for me before, however I am not using it for hldsupdatetool, but merely providing that as an example.
Big Daddy
(14 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7-4970k ASUS Z97-A 2 x EVGA GTX 980Ti Classified 32GB DDR3 1866MHz Corsair Dominators 
Hard DriveCoolingOSMonitor
2 x Samsung 1TB EVO SSD Corsair H80i Windows 10 x64 ASUS ROG Swift M 
KeyboardPowerCaseMouse
Vortex Pok3r Corsair 1200W Jonsbo UMX3 Mionix 
  hide details  
Reply
Big Daddy
(14 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7-4970k ASUS Z97-A 2 x EVGA GTX 980Ti Classified 32GB DDR3 1866MHz Corsair Dominators 
Hard DriveCoolingOSMonitor
2 x Samsung 1TB EVO SSD Corsair H80i Windows 10 x64 ASUS ROG Swift M 
KeyboardPowerCaseMouse
Vortex Pok3r Corsair 1200W Jonsbo UMX3 Mionix 
  hide details  
Reply
post #7 of 27
Sure, I get that.

However, that is why there are parameter options built into the shortcuts in windows, that is how they are supposed to be executed. The next way you are supposed to do this would be using a batch file.

If you need it to be in an executable (for what reason I can't imagine) you will just need to write a small program which executes your intended EXE with the proper paramters, and then compile that and put it in the directory of the program you want to execute (or build a way for it to find the EXE into your program).

You can do this in virtually any language, even BASIC (with a compiler capable of producing an EXE). Depending on the language, the commands will be different, but you should only need to look at the language reference for "Executing external programs", etc. to find out the code.

I think in BASIC it is shell or shellexecute.
Edited by _02 - 1/25/11 at 9:08am
    
CPUMotherboardGraphicsRAM
Phenom II X3 720 @ 3.5 (1.39v) Gigabyte GA-MA790XT-UD4P ASUS 5850 @ 880/1180 (1.118v) 4gb 1333mhz G.Skill DDR3 
Hard DriveHard DriveHard DriveHard Drive
64gb Crucial M4 SSD 3x 250gb WD2500JD - RAID0 1tb WD1001FALS 1tb WD10EARS 
Optical DriveCoolingOSMonitor
Pioneer DLDVD/CDRW Arctic Freezer Pro 64 Win 7 64bit Ultimate E2305 LG 23" LED 
KeyboardPowerCaseMouse
Filco Majestouch II Ninja Tenkeyless Fortron BlueStorm II 500w CM 690II Advanced Razer DeathAdder 
Mouse PadAudioAudio
generic Echo Miamidi PCI M-Audio BX5a Studio Monitors 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Phenom II X3 720 @ 3.5 (1.39v) Gigabyte GA-MA790XT-UD4P ASUS 5850 @ 880/1180 (1.118v) 4gb 1333mhz G.Skill DDR3 
Hard DriveHard DriveHard DriveHard Drive
64gb Crucial M4 SSD 3x 250gb WD2500JD - RAID0 1tb WD1001FALS 1tb WD10EARS 
Optical DriveCoolingOSMonitor
Pioneer DLDVD/CDRW Arctic Freezer Pro 64 Win 7 64bit Ultimate E2305 LG 23" LED 
KeyboardPowerCaseMouse
Filco Majestouch II Ninja Tenkeyless Fortron BlueStorm II 500w CM 690II Advanced Razer DeathAdder 
Mouse PadAudioAudio
generic Echo Miamidi PCI M-Audio BX5a Studio Monitors 
  hide details  
Reply
post #8 of 27
Yeah, I don't get it either. I think the thing here is that why does it need to be an .EXE? Is there a reason why it needs to be .EXE extension? I think this is what is confusing everyone.
Skylake Is Here!
(17 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7 6700K Batch #L535B021 4.7Ghz @ 1.296V GIGABYTE G1 Gaming GA-Z170X-Gaming 7 EVGA Geforce GTX 970 SSC ACX 2.0+ G.SKILL TridentZ 16GB DDR4 3000 
Hard DriveHard DriveHard DriveCooling
Samsung 950 Pro M.2 512GB  Crucial BX100 250 GB SanDisk SSDPlus 240 GB NZXT Kraken X61  
OSMonitorKeyboardPower
Windows 8.1 & 10 Dell UltraSharp 2913WM 21:9 2560x1080 Ducky Shine 4, CODE WASD, Deck Legend, G710+ EVGA SuperNova G2 850W 
CaseMouseMouse PadAudio
Phanteks Enthoo Evolv ATX Mid-Tower Ducky Secret SteelSeries Fostex Purple Heart TH-X00 
Audio
AKG K553 Pro, Philips SHP9500, Superlux 668B, S... 
  hide details  
Reply
Skylake Is Here!
(17 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7 6700K Batch #L535B021 4.7Ghz @ 1.296V GIGABYTE G1 Gaming GA-Z170X-Gaming 7 EVGA Geforce GTX 970 SSC ACX 2.0+ G.SKILL TridentZ 16GB DDR4 3000 
Hard DriveHard DriveHard DriveCooling
Samsung 950 Pro M.2 512GB  Crucial BX100 250 GB SanDisk SSDPlus 240 GB NZXT Kraken X61  
OSMonitorKeyboardPower
Windows 8.1 & 10 Dell UltraSharp 2913WM 21:9 2560x1080 Ducky Shine 4, CODE WASD, Deck Legend, G710+ EVGA SuperNova G2 850W 
CaseMouseMouse PadAudio
Phanteks Enthoo Evolv ATX Mid-Tower Ducky Secret SteelSeries Fostex Purple Heart TH-X00 
Audio
AKG K553 Pro, Philips SHP9500, Superlux 668B, S... 
  hide details  
Reply
post #9 of 27
Thread Starter 
Quote:
Originally Posted by _02;12136951 
Sure, I get that.

However, that is why there are parameter options built into the shortcuts in windows, that is how they are supposed to be executed. The next way you are supposed to do this would be using a batch file.

If you need it to be in an executable (for what reason I can't imagine) you will just need to write a small program which executes your intended EXE with the proper paramters, and then compile that and put it in the directory of the program you want to execute (or build a way for it to find the EXE into your program).

You can do this in virtually any language, even BASIC (with a compiler capable of producing an EXE). Depending on the language, the commands will be different, but you should only need to look at the language reference for "Executing external programs", etc. to find out the code.

I think in BASIC it is shell or shellexecute, but I haven't programmed in BASIC since DOS =)

That would be optimal. The .exe will be in the same place as the other one, the only difference between the two would be that the single exe will have all the necessary parameters included, so I don't have to create shortcuts all the time and I just launch it.

However my question still stands whats the best way of doing this? I know very little to no C++.
Big Daddy
(14 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7-4970k ASUS Z97-A 2 x EVGA GTX 980Ti Classified 32GB DDR3 1866MHz Corsair Dominators 
Hard DriveCoolingOSMonitor
2 x Samsung 1TB EVO SSD Corsair H80i Windows 10 x64 ASUS ROG Swift M 
KeyboardPowerCaseMouse
Vortex Pok3r Corsair 1200W Jonsbo UMX3 Mionix 
  hide details  
Reply
Big Daddy
(14 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7-4970k ASUS Z97-A 2 x EVGA GTX 980Ti Classified 32GB DDR3 1866MHz Corsair Dominators 
Hard DriveCoolingOSMonitor
2 x Samsung 1TB EVO SSD Corsair H80i Windows 10 x64 ASUS ROG Swift M 
KeyboardPowerCaseMouse
Vortex Pok3r Corsair 1200W Jonsbo UMX3 Mionix 
  hide details  
Reply
post #10 of 27
You can't just open a compiled exe file and add parameters to it. You either need to pass them in a DOS shell (batch file) or with a Windows shortcut.
Intellect v2
(9 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-6700K Processor ASUS ROG MAXIMUS VIII HERO LGA1151 DDR4 M.2 SAT... EVGA GTX 1080 SC ACX 3.0 Crucial Ballistix Sport 32GB DDR4 2400 MT/s (PC... 
CoolingKeyboardPowerCase
Noctua NH-D15 Das Keyboard 4 Professional (Brown) Corsair AX860 Fractal Design Define R5 
Mouse
MIONIX NAOS 7000 
  hide details  
Reply
Intellect v2
(9 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-6700K Processor ASUS ROG MAXIMUS VIII HERO LGA1151 DDR4 M.2 SAT... EVGA GTX 1080 SC ACX 3.0 Crucial Ballistix Sport 32GB DDR4 2400 MT/s (PC... 
CoolingKeyboardPowerCase
Noctua NH-D15 Das Keyboard 4 Professional (Brown) Corsair AX860 Fractal Design Define R5 
Mouse
MIONIX NAOS 7000 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Create .exe file from shortcut?