Command line Flags: Difference between revisions
(Created page with "<span id="using-flags-with-efpse"></span> == Using Flags with EFPSE == EFPSE can be passed a few different flags to the executable. These flags are as follows: <span id="example-flags"></span> === Example Flags === # '''Game.exe -console''' #* Command: <code>"C:/../../Desktop/Projects/Game.exe" -console</code> #* Description: Will launch the game with the console open. # '''Game.exe -data ProjectName''' #* Command: <code>"C:/../../Desktop/Projects/Game....") |
(Fix the formatting this should be good enough to show to the public) |
||
Line 84: | Line 84: | ||
<li><p>'''Open PowerShell''': Press <code>Win + R</code>, type <code>powershell</code>, and press Enter.</p></li> | <li><p>'''Open PowerShell''': Press <code>Win + R</code>, type <code>powershell</code>, and press Enter.</p></li> | ||
<li><p>'''Check for PowerShell Profile''': First, check if you have a PowerShell profile file. In PowerShell, type:</p> | <li><p>'''Check for PowerShell Profile''': First, check if you have a PowerShell profile file. In PowerShell, type:</p> | ||
< | <code>Test-Path $PROFILE</code> | ||
<p>If it returns <code>True</code>, a profile already exists. If it returns <code>False</code>, create one using:</p> | <p>If it returns <code>True</code>, a profile already exists. If it returns <code>False</code>, create one using:</p> | ||
< | <code>New-Item -Path $PROFILE -ItemType File -Force</code></li> | ||
<li><p>'''Open the Profile File''': Open the profile file in a text editor to add your custom command. Use:</p> | <li><p>'''Open the Profile File''': Open the profile file in a text editor to add your custom command. Use:</p> | ||
< | <code>notepad $PROFILE</code></li> | ||
<li><p>'''Define Your Custom Command''': Add a function to the profile file for your custom command. For example:</p> | <li><p>'''Define Your Custom Command''': Add a function to the profile file for your custom command. For example:</p> | ||
< | <code>function game {</code> | ||
<code> param (</code> | |||
<code> [Parameter(ValueFromRemainingArguments=$true)]</code> | |||
} | <code> [string[]]$args</code> | ||
</ | |||
<code> )</code> | |||
<code> & "C:\Users\SeltT\OneDrive\Desktop\Projects\Game.exe" @args</code> | |||
<code>}</code> | |||
</li> | |||
<li><p>'''Save and Close''': Save the changes and close the text editor.</p></li> | <li><p>'''Save and Close''': Save the changes and close the text editor.</p></li> | ||
<li><p>'''Reload Profile''': Reload the profile to apply the changes. In PowerShell, type:</p> | <li><p>'''Reload Profile''': Reload the profile to apply the changes. In PowerShell, type:</p> | ||
< | <code>. $PROFILE</code></li></ol> | ||
<span id="using-your-custom-command"></span> | <span id="using-your-custom-command"></span> | ||
Line 109: | Line 115: | ||
<ul> | <ul> | ||
<li><p>To launch the game with the console:</p> | <li><p>To launch the game with the console:</p> | ||
< | <code>game -console</code></li> | ||
<li><p>To launch the game with a specific project name:</p> | <li><p>To launch the game with a specific project name:</p> | ||
< | <code>game -data ProjectName</code></li> | ||
<li><p>To launch the game from a specific map number:</p> | <li><p>To launch the game from a specific map number:</p> | ||
< | <code>game -map 1</code></li></ul> | ||
<span id="using-the-multiple-flags"></span> | <span id="using-the-multiple-flags"></span> | ||
Line 120: | Line 126: | ||
<ul> | <ul> | ||
<li><p>To launch the game with multiple flags:</p> | <li><p>To launch the game with multiple flags:</p> | ||
< | <code>game -console -data -map 1</code></li></ul><span id="disclaimer"></span> | ||
<span id="disclaimer"></span> | |||
== Disclaimer == | == Disclaimer == | ||
AI DISCLAIMER: AI was used to format, arrange, and make edits to the above text | AI DISCLAIMER: AI was used to format, arrange, and make edits to the above text |
Revision as of 18:55, 5 June 2024
Using Flags with EFPSE
EFPSE can be passed a few different flags to the executable. These flags are as follows:
Example Flags
- Game.exe -console
- Command:
"C:/../../Desktop/Projects/Game.exe" -console
- Description: Will launch the game with the console open.
- Command:
- Game.exe -data ProjectName
- Command:
"C:/../../Desktop/Projects/Game.exe" -data ProjectName
- Description: This one works with Game.exe stored in Projects folder. Works the same as “Test Game” function. Preferred method for testing because manual edits of DAT files aren’t reset.
- Command:
- Game.exe -map number
- Command:
"C:/../../Desktop/Projects/Game.exe" -map 1
- Description: Launching your game from exact map number, starts from zero. Same as “Test Current Map”.
- Command:
- Multiple Flags
- Command:
"C:/../../Desktop/Projects/Game.exe" -console -data ProjectName -map 1
- Description: Combining multiple flags in a single command.
- Command:
How to Use a Flag: Create a Shortcut
The simplest method to use these flags is to create a shortcut. Follow these step-by-step instructions:
Step 1: Create a Basic Shortcut
Right-click on the Desktop: Right-click on any empty space on your desktop.
Select ‘New’ > ‘Shortcut’: From the context menu, choose “New” and then “Shortcut”.
Enter the Path of the Program: A window will appear asking for the location of the item. Enter the full path of the executable file you want to create a shortcut for. For example:
"C:/../../Desktop/Projects/Game.exe"
Click ‘Next’: After entering the path, click the “Next” button.
Name Your Shortcut: Enter a name for your shortcut, such as “Launch Game with Console”.
Click ‘Finish’: Click the “Finish” button to create the shortcut.
Step 2: Modify the Shortcut to Accept Command-Line Options
- Right-click on the Shortcut: Locate the shortcut you just created on the desktop, right-click on it, and select “Properties”.
- Edit the ‘Target’ Field: In the “Shortcut” tab, you will see a field labeled “Target”. This field will show the path to your program.
- Add Command-Line Options: To pass command-line options, append them to the target path. For example:
To open the game with the console:
"C:/../../Desktop/Projects/Game.exe" -console
To test with project data:
"C:/../../Desktop/Projects/Game.exe" -data ProjectName
To start from a specific map:
"C:/../../Desktop/Projects/Game.exe" -map 1
To combine multiple flags:
"C:/../../Desktop/Projects/Game.exe" -console -data ProjectName -map 1
- Save Your Changes: After adding the necessary options, click “Apply” and then “OK” to save your changes.
Step 3: Using Your Shortcut
- Double-click the Shortcut: Simply double-click the shortcut to run it with the specified command-line options.
- Verify the Behavior: Ensure that the game behaves as expected with the options you provided.
Additional Tips
Environment Variables: You can use environment variables in the target path, such as
%USERPROFILE%
.Quotes: If your paths or options contain spaces, enclose them in double quotes. For example:
"C:/../../Desktop/Projects/Game.exe" "-data Project Name"
Administrative Rights: If the program requires administrative rights, you may need to set the shortcut to run as administrator. In the properties window, go to the “Shortcut” tab, click “Advanced…”, and check “Run as administrator”.
By following these instructions, you can easily create and use a shortcut that passes command-line options to EFPSE in Windows 10 or 11.
Setting up a command for Powershell
Creating custom commands in PowerShell to run specific programs with parameters, like game -data projectName
, involves defining functions and adding them to your PowerShell profile. Here’s how you can set this up:
Step-by-Step Instructions
Open PowerShell: Press
Win + R
, typepowershell
, and press Enter.Check for PowerShell Profile: First, check if you have a PowerShell profile file. In PowerShell, type:
Test-Path $PROFILE
If it returns
True
, a profile already exists. If it returnsFalse
, create one using:New-Item -Path $PROFILE -ItemType File -Force
Open the Profile File: Open the profile file in a text editor to add your custom command. Use:
notepad $PROFILE
Define Your Custom Command: Add a function to the profile file for your custom command. For example:
function game {
param (
[Parameter(ValueFromRemainingArguments=$true)]
[string[]]$args
)
& "C:\Users\SeltT\OneDrive\Desktop\Projects\Game.exe" @args
}
Save and Close: Save the changes and close the text editor.
Reload Profile: Reload the profile to apply the changes. In PowerShell, type:
. $PROFILE
Using Your Custom Command
Now you can use your custom game
command in PowerShell. Here are a few examples:
To launch the game with the console:
game -console
To launch the game with a specific project name:
game -data ProjectName
To launch the game from a specific map number:
game -map 1
Using the multiple flags
To launch the game with multiple flags:
game -console -data -map 1
Disclaimer
AI DISCLAIMER: AI was used to format, arrange, and make edits to the above text