# Commandline -WinX -WinY don't work (get overridden)

**URL:** <https://forums.unrealengine.com/t/commandline-winx-winy-dont-work-get-overridden/395707>\
**Category:** Platform & Builds\
**Tags:** window, position, command-line, unreal-engine, Multiplayer, question\
**Created:** [June 5, 2017, 10:18pm UTC](https://forums.unrealengine.com/t/commandline-winx-winy-dont-work-get-overridden/395707 "2017-06-05T22:18:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spoondog](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Spoondog](https://forums.unrealengine.com/u/Spoondog)\
**Post date:** [June 5, 2017, 10:18pm UTC](https://forums.unrealengine.com/t/commandline-winx-winy-dont-work-get-overridden/395707/1 "2017-06-05T22:18:36Z")

</div>

I’m using 4.16.1 and making a multiplayer game that I need to test via standalone fairly often, so I have a shortcut each for server and client launch, where I attempt to place the windows using commandline e.g.:

UE4Editor.exe “” MainMenu -game -log -windowed -ResX=1280 -ResY=720 -WinX=0 -WinY=30 ConsoleX=0 ConsoleY=0

When the window initially pops up - it is correctly placed where I want it, but after it loads the startup map it centers itself on the screen.

I’ve tried making sure CenterStandaloneWindow=false just in case that was affecting it, but it doesn’t seem to help.

The Console / Log window correctly appears where I position it and does not move.

Any workarounds for this? Messing around with window focus & positioning them manually with the mouse every launch sucks a lot of time out of the day.

---

<div class="post-metadata">

**Author:** ![Alex-V](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Alex-V](https://forums.unrealengine.com/u/Alex-V)\
**Post date:** [August 18, 2017, 8:43am UTC](https://forums.unrealengine.com/t/commandline-winx-winy-dont-work-get-overridden/395707/2 "2017-08-18T08:43:05Z")

</div>

Confirm that. Dug around but without any success.

---

<div class="post-metadata">

**Author:** ![solarisx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@solarisx](https://forums.unrealengine.com/u/solarisx)\
**Post date:** [August 24, 2017, 4:19pm UTC](https://forums.unrealengine.com/t/commandline-winx-winy-dont-work-get-overridden/395707/3 "2017-08-24T16:19:24Z")

</div>

Have the same problem with Launch Profiles or GameUserSettings.ini in UE 4.16.3.  
WinX, WinY or for .ini WindowPosX, WindowPosY do not work.  
ResX, ResY or for .ini ResolutionSizeX, ResolutionSizeY work.

---

<div class="post-metadata">

**Author:** ![ayamashev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ayamashev](https://forums.unrealengine.com/u/ayamashev)\
**Post date:** [August 27, 2017, 5:38pm UTC](https://forums.unrealengine.com/t/commandline-winx-winy-dont-work-get-overridden/395707/4 "2017-08-27T17:38:08Z")

</div>

I have the same problem. A window appears where I want but then immediately jumps to the center of screen. This problem probably comes from  
_void FSceneViewport::ResizeFrame(uint32 NewWindowSizeX, uint32 NewWindowSizeY, EWindowMode::Type NewWindowMode)_  
in  
_Source\Runtime\Engine\Private\Slate\SceneViewport.cpp_

---

<div class="post-metadata">

**Author:** ![Alex-V](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Alex-V](https://forums.unrealengine.com/u/Alex-V)\
**Post date:** [August 27, 2017, 6:03pm UTC](https://forums.unrealengine.com/t/commandline-winx-winy-dont-work-get-overridden/395707/5 "2017-08-27T18:03:08Z")

</div>

Exactly. The wrong window mode comes in. But i didn’t realize why. The issue occurs only in packaged game. The correct window mode, position and size correctly parses from command line but then window mode corrupts on the way. And as consequence the method thinks that new window mode has been set and does center window.

---

<div class="post-metadata">

**Author:** ![ayamashev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ayamashev](https://forums.unrealengine.com/u/ayamashev)\
**Post date:** [August 27, 2017, 7:39pm UTC](https://forums.unrealengine.com/t/commandline-winx-winy-dont-work-get-overridden/395707/6 "2017-08-27T19:39:13Z")

</div>

I have just created ‘bug report’ question here:

> **[Can't specify custom window positions in 'windowed' mode](https://forums.unrealengine.com/questions/700447/cant-specify-custom-window-positions-in-windowed-m.html)**
>
> The problem appeared in UE4.16 and still exists (4.17.1). Description: When packaged game is launched with custom location and size in windowed mode (for example with arguments “-windowed WinX=50 WinY=50 ResX=800 ResY=600”) the window appears as...

I’m not sure if this question is marked as a ‘bug report’ so I’ve created new one.

---

<div class="post-metadata">

**Author:** ![ayamashev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ayamashev](https://forums.unrealengine.com/u/ayamashev)\
**Post date:** [August 29, 2017, 4:46pm UTC](https://forums.unrealengine.com/t/commandline-winx-winy-dont-work-get-overridden/395707/7 "2017-08-29T16:46:56Z")

</div>

The possibility to specify window location and size is extremely important to me so I had to find some workaround. I’d like to share it. Build the Engine with updated SceneViewport.cpp:

```
void FSceneViewport::ResizeFrame(uint32 NewWindowSizeX, uint32 NewWindowSizeY, EWindowMode::Type NewWindowMode)
{
	...
	if (NewWindowMode == EWindowMode::Windowed)
	{
		// Replace this block's content with this only string
		NewWindowPos.Reset();
	}
	else
	...
}

```

This probably will break the windowed full-screen mode. So if you don’t want to lose any other functionality you will have to prepare complete fix or some proper workaround (i.e. reshape a window via Blueprints). As for my situation, I need only windowed mode with custom location/size since I launch multiple game instances simultaneously.

---

<div class="post-metadata">

**Author:** ![dbrueck](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dbrueck](https://forums.unrealengine.com/u/dbrueck)\
**Post date:** [January 29, 2021, 4:54pm UTC](https://forums.unrealengine.com/t/commandline-winx-winy-dont-work-get-overridden/395707/8 "2021-01-29T16:54:24Z")

</div>

I know this is old but Google brought me here because it still doesn’t work in 4.25. I found that adding a ‘-WINDOWED’ command line parameter is what makes the other parameters work. So to test multiplayer locally I do this for the server:

```
<fullpath>\UE4Editor.exe <fullpath>\mygame.uproject Minimal_Default?listen -game -ResX=800 -ResY=500 -WinX=0 -WinY=30 -WINDOWED -log

```

and this for a client:

```
 <fullpath>\UE4Editor.exe <fullpath>\mygame.uproject 127.0.0.1 -game -ResX=800 -ResY=500 -WinX=850 -WinY=20 -WINDOWED -log
```

---

<div class="post-metadata">

**Author:** ![LiamBeckettDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/liambeckettdev/32/575752_2.png) [@LiamBeckettDev](https://forums.unrealengine.com/u/LiamBeckettDev)\
**Post date:** [January 18, 2023, 5:07am UTC](https://forums.unrealengine.com/t/commandline-winx-winy-dont-work-get-overridden/395707/9 "2023-01-18T05:07:30Z")

</div>

Similarly to dbrueck, I have come across this thread when trying to Google my bug.

My issue was that I was only trying to set WinX and wasn’t putting a WinY value. It seems for WinX to work you need to also define WinY in your command.
