Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Jun 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can I create a batch file using visual basic syntax?

    I am working on a project that allows users to create encrypt and decrypt their video files on a camera sd card.
    Can I create a file using visual basic and convert the vb file to batch file with *.bat extension?
    Batch file syntax is quite assembly-like language to me and I am more familiar with visual basic syntax.
    Is it possible?
    Any help would be greatly appreciated

    P.S : Can I create a batch file using ruby, which is another language that I am working on?


  2. #2
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    Willow Grove, Pennsylvania, USA
    Posts
    205
    Thanks
    4
    Thanked 49 Times in 40 Posts
    To point out a bit of possible confusion, Visual Basic is not the same thing as Visual Basic for Applications (the subject of this forum). Your question really belongs in the Windows Programming forum.

    You really can't make a batch file with Visual Basic. The batch file interpreter would have no idea what to do with any of the VB statements. What you can do instead is compile the VB program to make an executable (*.exe) file, and the batch file can then call the executable by just including its path and file name.

    The situation is exactly the same for Ruby, with the added complication that you'll first have to get a Ruby compiler which is not that common. See http://patshaughnessy.net/2012/2/15/...ed-or-compiled.

  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    You can create a 'batch' file in vbscript saved as a plain text file with a .vbs suffix. This can then be run from a command prompt if you want to run it the way you normally run batch scripts.

    A good place to start is doing a google search for the "The Scripting Guys"
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  4. #4
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,180
    Thanks
    47
    Thanked 983 Times in 913 Posts
    You can create a VBS file, e.g. encrypt.vbs, then run it from a batch file, e.g.
    @cscript //nologo encrypt.vbs

    cheers, Paul

  5. #5
    New Lounger
    Join Date
    Jun 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you so much for the answers. Thank you for the ruby resources and script guy.
    Have a good weekend.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •