Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Application Programming

Reply
 
LinkBack Thread Tools
Old 10-23-07   #1 (permalink)
logan's assistant :)
 
noobdown's Avatar
 
amd nvidia

Join Date: Sep 2006
Location: Overclock.net
Posts: 7,277

Rep: 712 noobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famous
Unique Rep: 478
Trader Rating: 2
Default batch file scrypting help

i have a batch file that when its ran it opens a program could some one tell me the syntax for while in a dos prompt after the application that is ran it puts it so the dos prompt is set as the default application instead of the app i opened with the batch file via cmd prompt
__________________
Official Cooler Master 690 Club
Quote:
Originally Posted by Syrillian View Post
Have a rest... sometimes it is the Human that needs the re-set.

System: Space Heater
CPU
9850
Motherboard
MA790GP-DS4H
Memory
g skills 1066 4x1
Graphics Card
4830
Hard Drive
2x80 (raid 0) 250g
Power Supply
750
CPU cooling
s1283
noobdown is offline Overclocked Account   Reply With Quote
Old 10-23-07   #2 (permalink)
WaterCooler
 
Criss's Avatar
 
intel nvidia

Join Date: Aug 2007
Location: Mississippi
Posts: 707

Rep: 55 Criss is acknowledged by some
Unique Rep: 45
Trader Rating: 9
Default

Quote:
Originally Posted by noobdown View Post
i have a batch file that when its ran it opens a program could some one tell me the syntax for while in a dos prompt after the application that is ran it puts it so the dos prompt is set as the default application instead of the app i opened with the batch file via cmd prompt

Translation:
Quote:
I have a batch file that opens a program when run. Could someone tell me the syntax for my batch file so that when it's run the dos prompt receives focus instead of the program run by the batch file.
The point of your batch file is to open program, and this is in fact what it's doing. By default it gives focus to the new program. As far as I know you can not tell the batch file to give the focus back to the dos prompt. I assume you are running this in Windows, so my question is this: What are you running with the batch program, and why do you want it to give focus back to the dos prompt?
__________________
Please read this before posting threads, replying to threads, and editing your signature.
Additional Signature, Thread, and Posting Rules: Overclock.net Professionalism Initiative

Evey Hammond
: Who...who are you?
V: Who? Who is but the form following the function of what. And what I am, is a man in a mask.
Evey Hammond: I can see that.
V: Of course you can. I'm not questioning your powers of observation, I'm merely remarking on the paradox of asking a masked man who he is.

System: <Title Goes Here>
CPU
Q6600 G0 @ 3.4 GHz | 1.34v
Motherboard
Gigabyte DS3R
Memory
4GB DDR2-800 Ballistix @ 950MHz (4-4-4-12)
Graphics Card
XFX 8800 GTS - 320MB @ 650/1026
Hard Drive
2x Seagate 400GB SATA-II (RAID0)
Sound Card
X-Fi Fatal1ty XtremeGamer
Power Supply
PC Power & Cooling 750W Silencer
Case
Gigabyte Aurora 3D BLK-FT
CPU cooling
D-TEK Fuzion
GPU cooling
EK 8800 GTS Full Cover
OS
Vixta x64 Business
Monitor
Samsung 215TW & 910T
Criss is offline Criss's Gallery   Reply With Quote
Old 10-23-07   #3 (permalink)
logan's assistant :)
 
noobdown's Avatar
 
amd nvidia

Join Date: Sep 2006
Location: Overclock.net
Posts: 7,277

Rep: 712 noobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famous
Unique Rep: 478
Trader Rating: 2
Default

Quote:
Originally Posted by Criss View Post
Translation:


The point of your batch file is to open program, and this is in fact what it's doing. By default it gives focus to the new program. As far as I know you can not tell the batch file to give the focus back to the dos prompt. I assume you are running this in Windows, so my question is this: What are you running with the batch program, and why do you want it to give focus back to the dos prompt?
cause i want it to go back to the prompt so it will close it
i am using the prompt to set the infinty on my computer to play a game and i made a batch file so i did not have to type it every time when i wanted it to play the game


when in the task manager it will not let me change the inffinity for the game i have to do it manually buy dos prompt
i can get the prompt to close with the switch /c but it does not run the game
__________________
Official Cooler Master 690 Club
Quote:
Originally Posted by Syrillian View Post
Have a rest... sometimes it is the Human that needs the re-set.

System: Space Heater
CPU
9850
Motherboard
MA790GP-DS4H
Memory
g skills 1066 4x1
Graphics Card
4830
Hard Drive
2x80 (raid 0) 250g
Power Supply
750
CPU cooling
s1283
noobdown is offline Overclocked Account   Reply With Quote
Old 10-23-07   #4 (permalink)
WaterCooler
 
Criss's Avatar
 
intel nvidia

Join Date: Aug 2007
Location: Mississippi
Posts: 707

Rep: 55 Criss is acknowledged by some
Unique Rep: 45
Trader Rating: 9
Default

Put all your commands in the batch file, and put a new line at the bottom with "exit".

The taskmanager should let you change the affinity, there is no reason that it shouldn't. Perhaps you aren't doing it right? Are you making sure to uncheck all of the cores that you don't want the game to run on?
(and it's Affinity, not infinity)
__________________
Please read this before posting threads, replying to threads, and editing your signature.
Additional Signature, Thread, and Posting Rules: Overclock.net Professionalism Initiative

Evey Hammond
: Who...who are you?
V: Who? Who is but the form following the function of what. And what I am, is a man in a mask.
Evey Hammond: I can see that.
V: Of course you can. I'm not questioning your powers of observation, I'm merely remarking on the paradox of asking a masked man who he is.

System: <Title Goes Here>
CPU
Q6600 G0 @ 3.4 GHz | 1.34v
Motherboard
Gigabyte DS3R
Memory
4GB DDR2-800 Ballistix @ 950MHz (4-4-4-12)
Graphics Card
XFX 8800 GTS - 320MB @ 650/1026
Hard Drive
2x Seagate 400GB SATA-II (RAID0)
Sound Card
X-Fi Fatal1ty XtremeGamer
Power Supply
PC Power & Cooling 750W Silencer
Case
Gigabyte Aurora 3D BLK-FT
CPU cooling
D-TEK Fuzion
GPU cooling
EK 8800 GTS Full Cover
OS
Vixta x64 Business
Monitor
Samsung 215TW & 910T
Criss is offline Criss's Gallery   Reply With Quote
Old 10-23-07   #5 (permalink)
logan's assistant :)
 
noobdown's Avatar
 
amd nvidia

Join Date: Sep 2006
Location: Overclock.net
Posts: 7,277

Rep: 712 noobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famous
Unique Rep: 478
Trader Rating: 2
Default

Quote:
Originally Posted by Criss View Post
Put all your commands in the batch file, and put a new line at the bottom with "exit".

The taskmanager should let you change the affinity, there is no reason that it shouldn't. Perhaps you aren't doing it right? Are you making sure to uncheck all of the cores that you don't want the game to run on?
(and it's Affinity, not infinity)
i know how the anfinnity works done it plenty of times before on xp( not on xp anymore)

i have tryied the exit after everything and it dose not close the prompt that was the frist syntax/command i tried and because the focus was on the new app that oppened it did not close the prompt
__________________
Official Cooler Master 690 Club
Quote:
Originally Posted by Syrillian View Post
Have a rest... sometimes it is the Human that needs the re-set.

System: Space Heater
CPU
9850
Motherboard
MA790GP-DS4H
Memory
g skills 1066 4x1
Graphics Card
4830
Hard Drive
2x80 (raid 0) 250g
Power Supply
750
CPU cooling
s1283
noobdown is offline Overclocked Account   Reply With Quote
Old 10-23-07   #6 (permalink)
WaterCooler
 
Criss's Avatar
 
intel nvidia

Join Date: Aug 2007
Location: Mississippi
Posts: 707

Rep: 55 Criss is acknowledged by some
Unique Rep: 45
Trader Rating: 9
Default

After a 10 second Google search I found this for you:
http://images.tomshardware.com/2004/...taskassign.zip

It is a program called TaskAssign and was reviewed by Tom's Hardware shortly after dual core cpu's became the latest rage. Anyway, this will let you add your games to a list and choose how you want them to run based on affinity, and remember those settings as long as you have TaskAssign running in the background. This should keep you from having 20 batch files laying around.

Here's how to set it up if you have any trouble:
http://www.tomshardware.com/2004/05/...uck/page3.html
__________________
Please read this before posting threads, replying to threads, and editing your signature.
Additional Signature, Thread, and Posting Rules: Overclock.net Professionalism Initiative

Evey Hammond
: Who...who are you?
V: Who? Who is but the form following the function of what. And what I am, is a man in a mask.
Evey Hammond: I can see that.
V: Of course you can. I'm not questioning your powers of observation, I'm merely remarking on the paradox of asking a masked man who he is.

System: <Title Goes Here>
CPU
Q6600 G0 @ 3.4 GHz | 1.34v
Motherboard
Gigabyte DS3R
Memory
4GB DDR2-800 Ballistix @ 950MHz (4-4-4-12)
Graphics Card
XFX 8800 GTS - 320MB @ 650/1026
Hard Drive
2x Seagate 400GB SATA-II (RAID0)
Sound Card
X-Fi Fatal1ty XtremeGamer
Power Supply
PC Power & Cooling 750W Silencer
Case
Gigabyte Aurora 3D BLK-FT
CPU cooling
D-TEK Fuzion
GPU cooling
EK 8800 GTS Full Cover
OS
Vixta x64 Business
Monitor
Samsung 215TW & 910T
Criss is offline Criss's Gallery   Reply With Quote
Old 10-24-07   #7 (permalink)
logan's assistant :)
 
noobdown's Avatar
 
amd nvidia

Join Date: Sep 2006
Location: Overclock.net
Posts: 7,277

Rep: 712 noobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famousnoobdown is becoming famous
Unique Rep: 478
Trader Rating: 2
Default

criss thanks for the app will it work with vista?
i am trying to lean towards batch files cause i want to learn how to right them properly

thanks again + rep
__________________
Official Cooler Master 690 Club
Quote:
Originally Posted by Syrillian View Post
Have a rest... sometimes it is the Human that needs the re-set.

System: Space Heater
CPU
9850
Motherboard
MA790GP-DS4H
Memory
g skills 1066 4x1
Graphics Card
4830
Hard Drive
2x80 (raid 0) 250g
Power Supply
750
CPU cooling
s1283
noobdown is offline Overclocked Account   Reply With Quote
Old 10-24-07   #8 (permalink)
WaterCooler
 
Criss's Avatar
 
intel nvidia

Join Date: Aug 2007
Location: Mississippi
Posts: 707

Rep: 55 Criss is acknowledged by some
Unique Rep: 45
Trader Rating: 9
Default

Quote:
Originally Posted by noobdown View Post
criss thanks for the app will it work with vista?
i am trying to lean towards batch files cause i want to learn how to right them properly

thanks again + rep
I personally haven't tried the app with Vista. I only know 100% it works with XP. Sorry I couldn't be of more help. I was looking about Google for batch file related information but came up rather empty handed. I'll poke around a bit more and see if I can't find you something. Keep your subscription to this thread =)
__________________
Please read this before posting threads, replying to threads, and editing your signature.
Additional Signature, Thread, and Posting Rules: Overclock.net Professionalism Initiative

Evey Hammond
: Who...who are you?
V: Who? Who is but the form following the function of what. And what I am, is a man in a mask.
Evey Hammond: I can see that.
V: Of course you can. I'm not questioning your powers of observation, I'm merely remarking on the paradox of asking a masked man who he is.

System: <Title Goes Here>
CPU
Q6600 G0 @ 3.4 GHz | 1.34v
Motherboard
Gigabyte DS3R
Memory
4GB DDR2-800 Ballistix @ 950MHz (4-4-4-12)
Graphics Card
XFX 8800 GTS - 320MB @ 650/1026
Hard Drive
2x Seagate 400GB SATA-II (RAID0)
Sound Card
X-Fi Fatal1ty XtremeGamer
Power Supply
PC Power & Cooling 750W Silencer
Case
Gigabyte Aurora 3D BLK-FT
CPU cooling
D-TEK Fuzion
GPU cooling
EK 8800 GTS Full Cover
OS
Vixta x64 Business
Monitor
Samsung 215TW & 910T
Criss is offline Criss's Gallery   Reply With Quote
Old 10-24-07   #9 (permalink)
Fear the Wombat
 
stanrc's Avatar
 
amd nvidia

Join Date: Apr 2007
Location: Stafford, VA
Posts: 4,771

Folding Team Rank: 87
Hardware Reviews: 7
Trader Rating: 5
Default

the reason exit doesn't work with your situation is because it is waiting for the program (game) you are running to finish and/or close before it continues with its next step, which would be exiting.

in all honesty, if you are using it to start a game, then why does it matter when the command prompt closes? just let it stay in the background and close when you finish playing the game.

also, if you want to avoid having a bunch of batch files, just make one with some switches and that way when you run it you choose which game you are going to play. its fun stuff, let me know if you decide to go that route and i can help if you need it.

System: VM Server
CPU
X2 3600+ 2.5
Motherboard
ASRock
Memory
8 GB G.Skill
Graphics Card
Integrated
Hard Drive
3x 320 GB, 500 GB
Power Supply
500w Antec Earthwatts
OS
Server 2008
stanrc is offline I fold for Overclock.net Overclocked Account   Reply With Quote
Old 10-24-07   #10 (permalink)
WaterCooler
 
Kriegen's Avatar
 
intel nvidia

Join Date: Mar 2007
Location: Alabama
Posts: 778

Rep: 95 Kriegen is acknowledged by some
Unique Rep: 77
Hardware Reviews: 1
Trader Rating: 2
Default

If I understand what you want is the ability to have a batch program start your game, set it's affinity and then close the dos window? You can do that using the start command. Here's an example of the commands in a batch file that would open up wordpad and close the dos window


Code:
start wordpad
exit
You could then just double click the batch file and you would see a dos window pop up, open wordpad and the dos window disappear.
__________________

Quote:
Artificial intelligence is no match for natural stupidity!
Quote:
The people who are crazy enough to think they can change the world are the ones who do.
Alabama Overclocker

System: Time to upgrade
CPU
E6600 L629F
Motherboard
ASUS P5K Deluxe
Memory
G.SKILL 2GB (2 x 1GB) DDR2 800
Graphics Card
EVGA 320MB GeForce 8800GTS 320MB
Hard Drive
3x WD Sata (1@320, 1@80, 1@100)
Sound Card
onboard
Power Supply
Antec Trio 650
Case
Lian Li 2000B
CPU cooling
D-Tek Fuzion, Rad:BIX360, Pump:AP1510, Dual BayRes
OS
Vista Ultimate 64bit
Monitor
Samsung 940BW
Kriegen is offline Kriegen's Gallery   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -4. The time now is 03:18 AM.


Overclock.net is a Carbon Neutral Site Creative Commons License Internet Security By ControlScan

Terms of Service / Forum Rules | Privacy Policy | Advertising | Become an Official Vendor
Copyright © 2008 Shogun Interactive Development. Most rights reserved.
Page generated in 0.33281 seconds with 8 queries