• 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

    • Same Internet Archive seemed to grab the new version https://web.archive.org/web/20...d/Setup_MakeMKV_v1.18.4.exe
    • Windows 11 KB5094126, KB5093998 bugging out Office apps but it may not be Microsoft's fault by Sayan Sen Microsoft last week released Windows 11 KB5094126 and KB5093998 as the latest Patch Tuesday updates. Following that the company also published the accompanying dynamic updates under KB5094149, KB5095971, and KB5094156. Although the tech giant did not acknowledge any major problems, some users online reported various issues ranging from OneDrive and Dropbox access problems, BitLocker recovery lockouts, to blue screens and BSODs. You can read about them in this dedicated piece. While there is still no confirmation about those problems from Microsoft the company has admitted to another bug which we did not report on. The tech giant has confirmed it has received reports of an issue in which certain third-party applications may be unable to launch Microsoft Office apps or open Office documents after installing the Patch Tuesday. This affects both Windows 11 as well as Windows 10. The company says the problem impacts a subset of applications that rely on OLE (Object Linking and Embedding) automation to communicate with Microsoft Office programs. According to Microsoft, affected scenarios involve third-party software attempting to open Office applications or documents from within their own interface. In such cases, the Office program may fail to launch altogether, or the requested document may not open. Oddly there may not be any error message, which probably makes the issue difficult to diagnose. The bug affects several Office products, including Word, Excel, PowerPoint, Access, and other apps in the Microsoft Office suite when they are launched through the affected software. These include tax and accounting software such as CCH Engagement and Workpaper Manager, dental practice management solutions like Dentrix and Softdent, as well as the popular research and reference management tool Zotero. Microsoft adds that other applications using similar Office integration methods could also experience the same problematic behavior. To understand the issue it is important to look at OLE, the Microsoft technology involved. OLE allows different applications to work together and share data, while its Automation feature lets one program control another. Thus this enables third-party software to launch Microsoft Office apps, open documents, and perform tasks automatically without requiring users to switch between programs. Because many accounting, healthcare, research, and business applications rely on OLE automation to interact with Word, Excel, PowerPoint, and other Office apps, any disruption can break those workflows. As a result, affected software may be unable to open Office documents or launch Office applications even though the programs themselves continue to work normally. At the moment the company has not provided a permanent fix though it has confirmed that engineers are actively working on a resolution, which will be delivered through a future Windows update. As such additional details will be shared once more information becomes available. In the meantime, Microsoft recommends a simple workaround for affected users whic is to open the Office application or document directly rather than launching it through the third-party program. For enterprise customers and organizations managing larger deployments, Microsoft says an additional mitigation is available. Admins experiencing the problem on their managed devices are advised to contact Microsoft Support for business to obtain and apply the workaround.
    • It saddens me when cars are such dull colours now. Mine is bright metallic blue and I absolutely adore it for standing out in contrast to that depressing backdrop of traffic.
    • Sparkle 2.20.0 by Razvan Serea Sparkle is a free, open-source Windows optimization tool designed to make your PC faster, cleaner, and more private. With Sparkle, you can easily debloat Windows by removing unnecessary apps and services, disable Microsoft tracking to enhance privacy, and apply performance tweaks to boost speed. Its cleaner removes junk and temporary files, while every change is safe and fully reversible. Sparkle also features a modern, user-friendly interface with automatic updates, making system maintenance simple. Explore over 39 tweaks, from disabling telemetry and hibernation to optimizing network and game settings, all aimed at customizing and enhancing your Windows experience. Sparkle supports Windows 10 and 11. Sparkle 2.20.0 changelog: Debloat Tweak has animated border New homepage loading UI New Tweak Modal (Markdown Supported) Refactored GPU Detection Added Tests with vitest Added foobar2000 to apps Added Localsend to apps Updated Modal Styles Added styles for disabled inputs Added Animated Border to debloat-windows tweak Bumped dependencies Refactor System info logic for speed Tweak info modals now support Markdown Added Clear System info cache to settings Redesigned Home Page Loading UI Changed Some Icons around the app Download: Sparkle 2.20.0 | Portable | ~100.0 MB (Open Source) Links: Sparkle Website | Github | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • lol it was a typo, fixed! haha imagine an actual 4TB Gen4 NVMe for $40 in 2026
  • Recent Achievements

    • 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
    • One Month Later
      Twozo Technologies earned a badge
      One Month Later
  • Popular Contributors

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

    Love Neowin? Tell a friend!