Jump to content

Converting Batch to C++

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
Panarchy

Panarchy

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 258 posts
Hello

Just need some advice

I'm trying to convert my Batch script to C++.

Any advice? My batch script currently loads system programs (such as explorer, disk management etc.), I'd like for it to be an .exe.

For various reasons I wouldn't like to do this the automated way.

Please tell me how to convert my script to a C++ program.

Thanks in advance,

Panarchy

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
For most lines in your batch script, you will have a system() call in C++. I'm curious why you would see an advantage in this being a .exe, however.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Panarchy

Panarchy

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 258 posts
Thanks

Can you please give me an example of the System() call command within full C++ code?

Thanks in advance,

Panarchy

PS: The advantage I see in using C++ versus Batch, is C++ is object orientated, so it can open more than one program at a time. Also, I can insert an icon much easier into an .exe compared with a .bat. Also... I'd like to know how to convert a Batch file to an EXE file.

#4
Panarchy

Panarchy

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 258 posts
Almost have it working now, just trying to work out how to get the environmental variables in.

Any advice would be appreciated.

Thanks in advance,

Panarchy

#5
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Unfortunately, I don't have any experience working with environment variables.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#6
shibbythestoner

shibbythestoner

    Programmer

  • Members
  • PipPipPipPip
  • 135 posts
lolvirus
Posted Image

#7
Panarchy

Panarchy

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 258 posts
LOL

Nup