[SOLVED]Custom .bat file help UPDATED

DiaSin

Honorable
Feb 7, 2013
914
0
11,160
I realized this is more of a windows question than an actual gaming question, even though it relates to that, so I deleted my original post and moved it here..


Due to financial constraints I am currently running the laptop my parents bought me for school back in 2009, which is underpowered by todays standards, as a gaming PC. (i.e. BF3 on low @ 1024x600 with average FPS ranging from 16-28 depending on the map)


As a result, when I play Star Wars: The Old Republic I have to run it at 1366x768. Normally this would cause no issues but there are a couple of things connected to that that are causing problems. There is a bug in the game that causes it to hang for awhile on exit with lower-end systems like mine, so I wrote an exceedingly simple bat file to task kill swtor.exe and set one of the macro keys on my Sidewinder X4 to execute the file. That works fine, but because of the way this particular game handles reduced resolutions, when I kill the exe my screen is stuck at 1366x768 instead of reverting to the full 1920x1080 resolution of my monitor.


What I am wondering is, what would I edit the .bat file to say in order to make it automatically change my screen resolution to 1920x1080 after the exe is killed so that I dont have to manually change it every time I close the game? This is what the file currently has for text..

taskkill /f /IM swtor.exe

----------------------------------------

Edit: I did find a small tool to add to the system32 folder ( http://www.nirsoft.net/utils/nircmd.html ) that will allow me to run the following command to change the resolution. I have tested that this command works after dropping the nircmd file into system32.

nircmd.exe setdisplay 1920 1080 32

How would I word my bat file to make it run both the command to kill the task, as I listed earlier, and the one to change the resolution?
 

DiaSin

Honorable
Feb 7, 2013
914
0
11,160
Its an MMO, it auto-patches with the launcher every time there is an update. Would not help anyway. Its something to do with the amount of memory usage that causes the hang. The only fix for that would be adding more memory to my system, which, being DDR2 notebook memory, would run me about $65 for the single 4GB stick, so that is NOT an option.

I am not asking for a fix for the hang, I am asking what changes I need to make to my .bat file to improve the fix I already came up with.
 

smokincola

Distinguished
Jan 2, 2012
73
0
18,660
I don't think you need to change your .bat file I think you need to look for a cfg or ini file in the install directory and see if you can force screen res there, then just for good measure I'd set the properties of that file to 'read only' if it isn't already.
 

_kaos_

Honorable
Nov 20, 2012
130
0
10,710

What you are calling a "fix" does not resolve the real issue...
I suggested to update the game because if it's a bug then it's likely to be fixed by an update...

AFAIK there is no cmd command that can achieve this (might be possible in PowerShell)
A quick search on google revealed this.
Display changer
It's a command line tool.
You can create a batch file so that this utility runs the game at the desired resolution and automatically restore it.
I myself have never used it so use it at your own risk.
 

DiaSin

Honorable
Feb 7, 2013
914
0
11,160



The problem isnt making the game run at a certain res, its that unless I sit at a black screen for 2-3 minutes to wait for the game to shut down after clicking quit instead task killing the game with my .bat file, my desktop resolution stays at the resolution I was running the game at. I did look this up on the SWTOR forums and all I have been able to come up with is that the hang is caused by the fact that the game uses about 2.5gb of my 4gb total system memory, meaning up to 98% memory usage at times.

This bat file was all I could come up with to avoid this. If it cannot be augmented to change the resolution I will just have to continue opening the screen resolution menu every time I close the game and changing it there.

Everyone, thanks for trying to help, I kind of figured it may not be possible. As much as I do know about computers my knowledge of the command line is rather limited so I thought I would ask here anyway.

Edit: Refer to my initial post, I have updated it.