Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
raptir

Shortcut prompt for input

Recommended Posts

Sort of Doom related because I want to use it for the Doom sourceports I play. Is there a way to make a Windows shortcut prompt for a command line argument when you run it? I know you can integrate a given argument into the shortcut, but I want something that I can change every time I want to run it. And I'd rather not navigate through the command prompt every time.

To clarify, I want to be able to make, say, a ZDoom shortcut that runs Zdoom.exe and prompts me for the "-iwad doom.wad -file (mod).wad" input.

Share this post


Link to post

Yeah, a shortcut to a batch file, let's call it doom.bat, with edit doom.bat in the Batch file field (under the Program tab in its Properties dialog). You'd place your full command line in the batch file, which is what you would edit.

The Batch file field simply tells Windows to execute a command line before the batch file or program linked to is executed.

Share this post


Link to post

Hm. I tried that, with doom.bat in the "Cmd line" field and "edit doom.bat" in the batch file field (with full paths, of course), and it just booted up the batch file immediately...

Share this post


Link to post

In any case, it's not much quicker than right clicking a shortcut, choosing properties and editing its command line. On the plus side, editing the shortcut directly has the benefit that you can skip the step if you know you'll be using the same commands you used the last time you played.

Share this post


Link to post

Yeah, that's true. Like I said, I'd love to be able to get something that would just prompt me every time.

Share this post


Link to post

Have you tried batch scripting yet? You should be able to do input prompts and such. Of course you have to be careful, because there are some differences between Windows 9x and 2000/XP, iirc.

Share this post


Link to post

I actually ended up writing something in BASIC real quick, since I already know that. Not sure on the rules of posting EXEs here, so I'll just post the code.

DIM argument AS STRING
INPUT "Argument: ", argument
SHELL "gzdoom.exe " + argument

Compiled with FreeBASIC and it runs fine from whatever directory my executable is in.

Share this post


Link to post

Oh, also, maybe someone who knows more about Windows can tell me this. Would the Run command be better in this case? I don't know how Shell works with memory usage in XP. Is it exactly the same as typing it into the command prompt?

Share this post


Link to post

Run works like a shortcut does, so you would have to supply a file path.

Also, you could stick a batch file that in the Windows directory that runs your source port with a default argument list. In the batch put something like:

c:\mypath\port.exe -iwad %1 -file %2

If it's named something like "gzdoom.bat" and you stick it in the Windows directory, you can open the Run prompt and type something like "gzdoom doom2.wad custom.wad" and it would run the source port with those arguements. I might not be 100% correct on my syntax as I just pulled that off the top of my head, but I do the same things for some common tasks.

You may or may not have to supply file extensions or add quotes. If anyone wants to clarify any of this, please do.

Share this post


Link to post

Ah, good to know. Well, like I said, I'm happy with my little executable for now.

Share this post


Link to post

Visual Studio .NET would probably do the trick for this problem. You can get it at your local Best Buy or whatever your tech store happens to be. Just a few hundred I think.

Share this post


Link to post

I don't know if it's the same as a .bat file or if you already knew this but you can make a .cmd file like this:

    open Notepad
    write "zdoom -iwad doom.wad -file (mod).wad" or whatever you want the parameters to be
    save into your zdoom directory. when you save it, change "save as type" from "Text Documents" to "All Files". then name it [whateveryouwant].cmd
    make a shortcut of this to the desktop

Share this post


Link to post

...you guys are aware that there are easier ways of achieving what you want, like...uhm....launchers, right? ...right?

Share this post


Link to post
Maes said:

...you guys are aware that there are easier ways of achieving what you want, like...uhm....launchers, right? ...right?

Especially the kind that allow you to run the wads directly from zips with any ports, saving time from extracting the wads and, at the same time, HD space...hint hint. ;-)



@AndrewB: You can download .NET SDKs for free from Microsoft's website, and get Sharpdev, which is a much better IDE that Visual Studio, also for free.

:-P

Share this post


Link to post

You could try this batch file:

@echo "Enter command line parameters" 
@set /p commandline=

zdoom %commandline%
Stick that in your Zdoom directory and double click it. It will prompt you for command line parameters then run zdoom with whatever you type in appended to the command line. Obviously, it can be modified for different ports or different situations. eg
@echo "Enter command line parameters" 
@set /p commandline=

zdoom -iwad doom2.wad %commandline%

Share this post


Link to post

If you run Windows 9X, you can stick a ? in the end to your shortcut's command to make Windows prompt for a cute little dialog box for parameters

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×