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? - Page 2

post #11 of 27
Quote:
Originally Posted by Limes;12137000 
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++.

Making shortcuts all of the time? You only have to make the shortcut once. What is the difference between that and going through all of the trouble to compile an entirely different program to pass parameters for you? That doesn't make any sense.
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
post #12 of 27
Thread Starter 
Quote:
Originally Posted by Plex View Post
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.
I never said you could. I am asking how to build an .exe with certain parameters already built into it.

Quote:
Originally Posted by Plex View Post
Making shortcuts all of the time? You only have to make the shortcut once. What is the difference between that and going through all of the trouble to compile an entirely different program to pass parameters for you? That doesn't make any sense.
Sigh...please stop straying away from the original question, and yes if I am running multiple versions of an application, I have to create a new shortcut and add the parameters again due to the fact its in entirely different directories, why should I do that when I can easily drop the new .exe in the same directory.

Either way my question isn't should I or should I not, its how can I, I would appreciate it if we could keep the discussion to my original post.
Edited by Limes - 1/25/11 at 9:17am
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 #13 of 27
Quote:
Originally Posted by Limes View Post
I never said you could. I am asking how to build an .exe with certain parameters already built into it.
Do you have the source code for the program you're talking about? If not, then you can't.

What is suggested above is that you create an entirely separate program that sits in the same location that just executes the original executable and adds the parameters at runtime. Literally the exact same thing creating a shortcut does.
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
post #14 of 27
Quote:
Originally Posted by Limes View Post
However my question still stands whats the best way of doing this? I know very little to no C++.
If you aren't familiar with any programming language capable of producing an executable, you are a long way from your solution (that is already solved by typing less than a line into your shortcut launch options).

I know you have some hidden reason that you want this EXE, so here is the code to achieve that in BASIC (compiled using liberty basic, a free compiler). It is very simple to set up and use, just install, type the code, and compile to exe.

Code:
run "PROGRAM.EXE -param1 -param2"
That one line will spit out a program that does just what you want. Global and local path applies for the location of the executable. BASIC is likely not the best language to program in, but you can get a free compiler and be done with this project in under 30 seconds.

Edit - Fixed code.
Edited by _02 - 1/25/11 at 9:23am
    
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 #15 of 27
1. Write a batch file as others have stated to launch the program.
2. Use this to make it an .exe
3. Run it.

I have done this all the time. It's awesome.
Lappy
(9 items)
 
  
CPUMotherboardGraphicsRAM
P8700 Toshiba GM45 ICH9-M Intel 4 Series Samsung M4 
Hard DriveOptical DriveOSCase
Hitachi HTS723232L9A360 Matshita UJ880AS Windows 7 Pro 64 Toshiba A500-6621 
Mouse
Mionix Naos 5000 
  hide details  
Reply
Lappy
(9 items)
 
  
CPUMotherboardGraphicsRAM
P8700 Toshiba GM45 ICH9-M Intel 4 Series Samsung M4 
Hard DriveOptical DriveOSCase
Hitachi HTS723232L9A360 Matshita UJ880AS Windows 7 Pro 64 Toshiba A500-6621 
Mouse
Mionix Naos 5000 
  hide details  
Reply
post #16 of 27
Quote:
Originally Posted by Wiremaster View Post
1. Write a batch file as others have stated to launch the program.
2. Use this to make it an .exe
3. Run it.

I have done this all the time. It's awesome.
Nifty!
    
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 #17 of 27
Quote:
Originally Posted by _02 View Post
Nifty!
Thanks.

To the OP, if you need help with batch, I am here for ya.
Lappy
(9 items)
 
  
CPUMotherboardGraphicsRAM
P8700 Toshiba GM45 ICH9-M Intel 4 Series Samsung M4 
Hard DriveOptical DriveOSCase
Hitachi HTS723232L9A360 Matshita UJ880AS Windows 7 Pro 64 Toshiba A500-6621 
Mouse
Mionix Naos 5000 
  hide details  
Reply
Lappy
(9 items)
 
  
CPUMotherboardGraphicsRAM
P8700 Toshiba GM45 ICH9-M Intel 4 Series Samsung M4 
Hard DriveOptical DriveOSCase
Hitachi HTS723232L9A360 Matshita UJ880AS Windows 7 Pro 64 Toshiba A500-6621 
Mouse
Mionix Naos 5000 
  hide details  
Reply
post #18 of 27
Thread Starter 
Quote:
Originally Posted by Wiremaster View Post
1. Write a batch file as others have stated to launch the program.
2. Use this to make it an .exe
3. Run it.

I have done this all the time. It's awesome.
Thanks, that did the job perfectly. + Rep
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 #19 of 27
Quote:
Originally Posted by Limes View Post
Sigh...please stop straying away from the original question, and yes if I am running multiple versions of an application, I have to create a new shortcut and add the parameters again due to the fact its in entirely different directories, why should I do that when I can easily drop the new .exe in the same directory.
I'm not straying at all. None of us are. We are trying to figure out your motives so we can help you. If you would have explained that you were trying to make a single portable file that you could drop anywhere then you would have avoided a lot of the questions that everyone had in this thread.

Quote:
Either way my question isn't should I or should I not, its how can I, I would appreciate it if we could keep the discussion to my original post.
Now that I know why exactly you want a portable .exe, the question isn't "how can I?" it's "can I?" and the answer to that is no, you can't.

Even with the batch method described right above me, you still need that batch file pointing back to the original location (or sitting in the same directory). This is the same thing as the shortcut.


The only way to do it is to have the source code and hard-code the parameters in that you want passed at compile time. That's not going to be easy (read: near impossible) for someone who doesn't have any programming experience.
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
post #20 of 27
Quote:
Originally Posted by Plex View Post
The only way to do it is to have the source code and hard-code the parameters in that you want passed at compile time. That's not going to be easy (read: near impossible) for someone who doesn't have any programming experience.
Eh, he can make an EXE or batch that simply executes with parameters in the local path, so that the location is irrelevant as long as this program and the one it calls are in the same directory.

Regardless, I would still use the shortcut but OP has the floor
    
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
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?