• 0

Warming up: simple .exe file


Question

Hey guys, I haven't programmed in VB in over a decade and I know a ton has changed. So I'll keep it simple.

 

I still play a game Ghost Recon Advanced Warfighter (GRAW) which came out in 2005.

 

I use a mod for the game named Brettzies Weapons pack 6.0 for GRAW (2005) and then GRAW2 (2007) brettzies weapon pack is 3.02. 

 

Here's the path to the required .bat file C:\Program Files (x86)\Ubisoft\Ghost Recon Advanced Warfighter and C:\Program Files (x86)\Ubisoft\Ghost Recon Advanced Warfighter 2

 

I hope what I want to do is simple. I know days of old a "shell" command would be used to start a program or in today's terms: an application. I'd like to create a simple application that will run the file "bp_weapons_pack_v6.0.bat" which will do this;

file: bp_weapons_pack_v6.0..bat 

graw.exe -o context_bp_weapons_pack_v6.0.xml  (the -o tells GRAW.exe to run the modified .xml file "context_bp_weapons_pack_v6.0.xml

 

can one start a program from an xml file? the .bat file tells GRAW.exe to read/use the bp_weapons_pack_v6.0.xml and it will incorporate the weapon models into GRAW to play the game.

 

Q: What syntax in today's VB (express) is/are used to start external applications? my old mind remembers to create a string

 

Maybe.. DIM GRAW As String or Integer....

 

then I recall faintly Shell calls. Does this -> still apply in shell calls?

 

Q: Why Do I want to do this? because I hate having to open the folder and dbl-click the .bat file everytime I want to use it. that and I'd like to pin the new .exe file/shortcut to my taskbar and start it from my taskbar.

 

I think it might be a simple task but with me, nothing is EVER easy sometimes. :D (yeah, I find that life is easier when I can laugh at myself).

 

Regards,

Chrisj1968

 

 

 

Link to comment
https://www.neowin.net/forum/topic/1303492-warming-up-simple-exe-file/
Share on other sites

23 answers to this question

Recommended Posts

  • 0

ok, the game (modded) runs from the .bat file which tells GRAW which .xml file to use. a lot like switches in games of old like (halflife.exe -devmode -god...)

 

so it has to be something I can execute.. I can't pin a .bat file to my taskbar.. I tried.

  • 0
10 minutes ago, chrisj1968 said:

...

 

 

 

Process.Start("<filename>", "<arguments>")

 

So

 

Process.Start("graw.exe", "-o context_bp_weapons_pack_v6.0.xml")

 

You can find a full example on the MSDN web site about the Process class here:

https://msdn.microsoft.com/en-us/library/system.diagnostics.process(v=vs.110).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-3

  • 0
Just now, virtorio said:

Process.Start("<filename>", "<arguments>")

 

So

 

Process.Start("graw.exe", "-o context_bp_weapons_pack_v6.0.xml")

 

You can find a full example on the MSDN web site about the Process class here:

https://msdn.microsoft.com/en-us/library/system.diagnostics.process(v=vs.110).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-3

that's MUCH simpler than the old days!  Virtorio, if you're ever in the Reno Area, hit me up, the family and I will treat you to Dinner on me.

  • 0
9 minutes ago, virtorio said:

Process.Start("<filename>", "<arguments>")

 

So

 

Process.Start("graw.exe", "-o context_bp_weapons_pack_v6.0.xml")

 

You can find a full example on the MSDN web site about the Process class here:

https://msdn.microsoft.com/en-us/library/system.diagnostics.process(v=vs.110).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-3

Didn't even think about this.

  • 0
2 minutes ago, BinaryData said:

Didn't even think about this.

no worries. you've always have been cool about helping people around here. I'm getting a win32 error in VB but I'm determined to get this working. it compiles fine, I'm missing something so I'll read that link Vitorio gave me.

  • 0
17 minutes ago, chrisj1968 said:

no worries. you've always have been cool about helping people around here. I'm getting a win32 error in VB but I'm determined to get this working. it compiles fine, I'm missing something so I'll read that link Vitorio gave me.

Feel free to post details about the error here. If the output executable is not placed in the games install folder, you will need to provide the full path to the executable, e.g:

 

Process.Start("C:\Program Files (x86)\Ubisoft\Ghost Recon Advanced Warfighter\graw.exe", "-o context_bp_weapons_pack_v6.0.xml")

 

Depending on how the game looks for files you may need to set the "working directory" to the games install folder, for which there is an easy way and a slightly more difficult way.

  • 0
2 minutes ago, virtorio said:

Feel free to post details about the error here. If the output executable is not placed in the games install folder, you will need to provide the full path to the executable, e.g:

 

Process.Start("C:\Program Files (x86)\Ubisoft\Ghost Recon Advanced Warfighter\graw.exe", "-o context_bp_weapons_pack_v6.0.xml")

 

Depending on how the game looks for files you may also set the "working directory" to the games install folder, for which there is an easy way and a slightly more difficult way.

I figured it out. If I created the app to use a button click, I had a ton of work to do and waste. So  I put the code on the form1.form and it boots automatically. I tried to put an Exit in there but it gave me an error.

 

I'm taking baby steps here but it works. I need to create an icon for it. here's the code. I'm relearning to put in comments for easier reading of code reading. good programmers, I remember live by it.

 

App_code.png

Now to pretty it up. I'll give it an Icon and possibly look into adding a check box to run modded or unmodded later

  • 0
13 minutes ago, chrisj1968 said:

I figured it out. If I created the app to use a button click, I had a ton of work to do and waste. So  I put the code on the form1.form and it boots automatically. I tried to put an Exit in there but it gave me an error.

 

I'm taking baby steps here but it works. I need to create an icon for it. here's the code. I'm relearning to put in comments for easier reading of code reading. good programmers, I remember live by it.

 

App_code.png

Now to pretty it up. I'll give it an Icon and possibly look into adding a check box to run modded or unmodded later

Could do an if statement with a check box, if box = check then blah blah else run blah blah. OR just a simple window "Normal Mode: Run!" below it would be "Modded Mode: Run!" and it would run the modded version. I haven't touched vb.net since 2007. I'm learning more of C++ but that's slow going.

  • 0

You don't need to create a program at all. 

Quote
  1. Create a shortcut to your batch file.
  2. Get into shortcut property and change target to something like: cmd.exe /C "path-to-your-batch".
  3. Simply drag your new shortcut to the taskbar. It should now be pinnable.
    http://superuser.com/questions/100249/how-to-pin-either-a-shortcut-or-a-batch-file-to-the-new-windows-7-8-and-10-task

 

 

  • 0
2 hours ago, Andre S. said:

You don't need to create a program at all. 

 

I believe you. I want to get back into programming. so I figured a simple .exe would be a good start. I haven't touched VB since around VB 4 (my age is showing right?). But I Downloaded VB Express 2015 last night and fired it up. I used to teach myself how to create simple databases. Created one that I could catalog all my DVD's in the late 1990's. 

  • 0
9 hours ago, BinaryData said:

Could do an if statement with a check box, if box = check then blah blah else run blah blah. OR just a simple window "Normal Mode: Run!" below it would be "Modded Mode: Run!" and it would run the modded version. I haven't touched vb.net since 2007. I'm learning more of C++ but that's slow going.

Geez, I didn't mean to fry your brain in the middle of learning C++. I might have to learn that language instead. I've heard it's extremely powerful, more so than VB.

  • 0
34 minutes ago, chrisj1968 said:

Geez, I didn't mean to fry your brain in the middle of learning C++. I might have to learn that language instead. I've heard it's extremely powerful, more so than VB.

It depends what's meant by powerful. Both languages have a different purpose. In a broad sence you could say that Ii you need to do low level or system programming, or you want to manage memory yourself, C++ will most likely be better for the job. For other types of applications, the .NET framework provides a rich set of libraries that allow you to write more with less code. This is however a very broad comparison. There is much more to take into consideration, more than I know about :) 

  • 0
Just now, Raphaël G. said:

It depends what's meant by powerful. Both languages have a different purpose. In a broad sence you could say that Ii you need to do low level or system programming, or you want to manage memory yourself, C++ will most likely be better for the job. For other types of applications, the .NET framework provides a rich set of libraries that allow you to write more with less code. This is however a very broad comparison. There is much more to take into consideration, more than I know about :) 

Agreed.

 

@chrisj1968

I've found that C++ is oriented towards more complex and large projects, while VB.Net has been better suited for smaller scale applications. Each language can be used for large or small, all depends on the project. We'll take creating a game for instance. Let's look at World of Warcraft. Yes, it can be developed in VB .Net, but will that suit it best? Probably not. That's where C++ or Assembly comes into play. You could look at Photoshop as another example. I've always found VB .Net to be the perfect tool creation language. It's easy, and straight to the point, while C++ you have to monkey with UI code, perfecting that, and THEN getting your core code in place.

  • 0

Question: I just had an epiphany. while on simple programming, I have a daughter who is on the PC too long. my idea, why can't I create an app that allows me to establish a set time of use, an hour or two and then loggoff automatically. have it run in the background and automatically logoff.

 

what would be a best route approach to this? I'd like to use a simplified way by using the system time feature within Windows 10.

  • 0
12 minutes ago, chrisj1968 said:

Question: I just had an epiphany. while on simple programming, I have a daughter who is on the PC too long. my idea, why can't I create an app that allows me to establish a set time of use, an hour or two and then loggoff automatically. have it run in the background and automatically logoff.

 

what would be a best route approach to this? I'd like to use a simplified way by using the system time feature within Windows 10.

Setup Family Safety. No need to reinvent the wheel.

  • 0
14 minutes ago, chrisj1968 said:

Question: I just had an epiphany. while on simple programming, I have a daughter who is on the PC too long. my idea, why can't I create an app that allows me to establish a set time of use, an hour or two and then loggoff automatically. have it run in the background and automatically logoff.

 

what would be a best route approach to this? I'd like to use a simplified way by using the system time feature within Windows 10.

http://digiparent.weebly.com/

 

This is free and does just that.

  • 0
9 hours ago, chrisj1968 said:

Geez, I didn't mean to fry your brain in the middle of learning C++. I might have to learn that language instead. I've heard it's extremely powerful, more so than VB.

Unless you intend to become a professional programmer in a field that uses C++ extensively (and there are fewer of those than you might think), don't waste your time. I'm not sure what your intentions are but you can write basically anything in VB.Net. Including operating systems and AAA games. If you spend a very long time writing VB you might find that it's somewhat verbose, that most code samples for .NET libraries are in C#, that it's hard to find other highly competent VB programmers to help you online; and that there are lots of really cool languages you could learn to help you become a better programmer (like Haskell, Clojure, Assembly, etc); at which point you might want to learn something else - but probably not C++.

 

Quote

I've found that C++ is oriented towards more complex and large projects, while VB.Net has been better suited for smaller scale applications.

Because of ...? VB.Net is basically a clone of C# with slightly different syntax and some language-specific namespaces and functions to make it easier for beginners and familiar to VB6 programmers. It's statically and quite strongly typed, has namespaces, first-class OOP support and ok FP support, generics, it's supported by ReSharper, it compiles quickly, it produces assemblies that can be easily consumed by any CLI language and turned into NuGet packages for painless inclusion in other projects. C++ actually lacks several of these traits (it has no notion of assemblies and isn't amenable to nice package management like NuGet/Fake, its compilation times are a huge problem on large projects, header file management is pure tedium and doesn't exist in any other language but C, tooling support was far off what you get with Visual Studio/ReSharper for C# and VB last time I checked). I personally found it a huge pain to work on large C++ projects and I had that unfortunate experience at several different companies; this along with many other flaws of the language ultimately drove me towards more productive technologies.

 

I would certainly never write a large project in C++; I might write some parts where I really need something only C++ can give me - placement new, intrinsics, really good codegen - but that's unlikely to be more than 5% of the code.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Hello, Also known for https://www.theguardian.com/technology/2009/jan/29/adware-internet.   Regards, Aryeh Goretsky    
    • Hello, I have used a few TEAM Group SSDs, USB flash drives, and Micro SDXC cards in the past. They all seemed to work fine. Regards, Aryeh Goretsky
    • "just $100 per TB"? Just? Are we trying to make this seem like the new normal? Kinda weird to make it sound like that is not a ridiculously expensive asking price.
    • The reviews you refer to mean nothing. Where there is no journalism there is no reason to call the gaming media's opinion pieces "reviews". For GP games there is indeed a metric for success - increasing subscriptions. Which turns in revenue. The only circumstance in which subs do not rise when great is being released is a Game Pass system where the company is close to fully saturated with customers in a subscription. However, in that case as the theory goes you spend aplenty in all kind of games - from shady live service cash cows and customer offending agitprop crap in purple colours to robust and entertaining single player games. And keep a solid level of profitability. Ignoring the simply innocuous but mid games MGS has released primarily of the second kind.
    • Report: Microsoft to use AWS to help GitHub deal with a major surge in demand by Pradeep Viswanathan Thanks to the surge of coding AI agents, GitHub's usage has skyrocketed over the past 12 months. To meet this demand, GitHub started with a plan in October 2025 to increase capacity by 10x. However, by early this year, the company realized that it needed 30x scale. This rapid growth has caused severe strain on the platform's reliability, resulting in several small outages over the past few months. In April, GitHub published a long blog post explaining the steps it is taking to resolve these reliability issues. In the post, the company also confirmed that it is working toward a multi-cloud architecture for better resilience. Today, Business Insider reported that GitHub is turning to Amazon Web Services to help deal with a major surge in AI-driven coding activity. It is important to note that GitHub is still in the process of moving completely to the Azure cloud. The current plan is to move the platform fully to Azure by 2027 so that it can scale better as per developer demand. Therefore, the current decision to utilize AWS might be part of a short-term plan to meet immediate demand. A Microsoft spokesperson confirmed that GitHub is using multiple cloud providers with the following statement: For Microsoft, the decision highlights the operational pressure behind the AI boom. GitHub has to stay reliable for developers at a time when rivals such as Codex, Cursor, Claude Code, and other AI coding tools are gaining attention. And the decision to use AWS for computing capacity seems practical given the circumstances.
  • Recent Achievements

    • Collaborator
      vjlex earned a badge
      Collaborator
    • Reacting Well
      Dys Topia earned a badge
      Reacting Well
    • Conversation Starter
      NovaEdgeX earned a badge
      Conversation Starter
    • One Year In
      Console General earned a badge
      One Year In
    • Week One Done
      Twozo Technologies earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      518
    2. 2
      +Edouard
      182
    3. 3
      PsYcHoKiLLa
      106
    4. 4
      Steven P.
      88
    5. 5
      ATLien_0
      68
  • Tell a friend

    Love Neowin? Tell a friend!