• 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

    • VirtualBox 7.2.10 by Razvan Serea VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use. Targeted at server, desktop and embedded use, it is now the only professional-quality virtualization solution that is also Open Source Software. Presently, VirtualBox runs on Windows, Linux, macOS, and Solaris hosts and supports a large number of guest operating systems including but not limited to Windows (NT 4.0, 2000, XP, Server 2003, Vista, 7, 8, Windows 10 and Windows 11), DOS/Windows 3.x, Linux (2.4, 2.6, 3.x, 4.x, 5.x and 6.x), Solaris and OpenSolaris, OS/2, OpenBSD, NetBSD and FreeBSD. Some of the features of VirtualBox are: Modularity. VirtualBox has an extremely modular design with well-defined internal programming interfaces and a client/server design. This makes it easy to control it from several interfaces at once: for example, you can start a virtual machine in a typical virtual machine GUI and then control that machine from the command line, or possibly remotely. VirtualBox also comes with a full Software Development Kit: even though it is Open Source Software, you don't have to hack the source to write a new interface for VirtualBox. Virtual machine descriptions in XML. The configuration settings of virtual machines are stored entirely in XML and are independent of the local machines. Virtual machine definitions can therefore easily be ported to other computers. VirtualBox 7.2.10 changelog: VMM: Fixed issue when CentOS 10 VM was not booting due to the message "Fatal glibc error: CPU does not support x86-64-v3" (​github:gh-642) Devices/EFI: Fixed booting issue when ARM VM had less than 1024 MiB of RAM assigned (​github:gh-679) USB: Fixed issue when it was not possible to attach USB device to headless VM on Apple Silicon/macOS 26.4.1 (​github:gh-631) Storage: Fixed issue when VIRTIO-SCSI device was not recognized as SSD device by guest system (​github:gh-634) Network: Fixed issue in E1000 emulation code which triggered debug log creation (​github:gh-645) Network: Fixed issue in E1000 emulation code which prevented OS/2 guest from booting (​github:gh-683) Linux Host: Fixed issue when VMs could not be started due to kernel oops (​github:gh-639) Linux Host and Guest: Fixed issue when kernel modules were failing to build with openSUSE 16.0 kernel Linux Host and Guest: Added initial support for kernel 7.1 Linux Host and Guest: Added extra fixes for RHEL 9.8 kernel (​github:gh-676) Linux Host and Guest: Added possibility to build source code using NASM instead of YASM as the assembler (​github:gh-520) Linux Guest Additions: Added initial support for Extended Data Control Protocol for clipboard sharing with Plasma on Wayland guests (​github:gh-33) Linux Guest Additions: Added extra fixes for preventing vboxvideo kernel module build with kernel version 7.0 and newer (​github:gh-655) OS/2 Guest Additions: Fixed issue when Shared Folders automount and clipboard sharing stopped working (​github:gh-551) Download: VirtualBox 7.2.10 | 170.0 MB (Open Source) Download: VirtualBox 7.2.10 Extension Pack | 19.1 MB View: VirtualBox Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • OK, now ask yourself how are they going to enforce that law? By requiring every single adult to prove their age and provide their legal identity documents to an UNREGULATED 3rd party company that already has a long track record of multiple data breaches. Not to mention, parliament have voted AGAINST this ban, twice, and Starmer is going ahead anyway. So, where's the democracy here, because that looks like dictatorship to me. The solution here is parental responsibility, not government control. Run some public service announcements on TV and UK social media teaching parents how to setup parental controls. That's already been proven to actually work. But the, this is not and has NEVER been about keeping kids safe. It's about control and monitoring. Watching what you're doing online and controlling what you can see and what you can say.
    • Interesting read. I knew the adware was quite controversial at the time, however never realised to the point The Guardian wrote an article about Patchou. I just said no and enjoyed his creation, I’d probably be a lot more wary of something like that today though.
  • Recent Achievements

    • One Month Later
      Prasann earned a badge
      One Month Later
    • Week One Done
      Prasann earned a badge
      Week One Done
    • First Post
      Dys Topia earned a badge
      First Post
    • Collaborator
      vjlex earned a badge
      Collaborator
    • Reacting Well
      Dys Topia earned a badge
      Reacting Well
  • Popular Contributors

    1. 1
      +primortal
      516
    2. 2
      +Edouard
      180
    3. 3
      PsYcHoKiLLa
      105
    4. 4
      Steven P.
      87
    5. 5
      ATLien_0
      68
  • Tell a friend

    Love Neowin? Tell a friend!