Results 1 to 4 of 4

Thread: Program to edit a section of .bat file?

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2012
    Posts
    2

    Program to edit a section of .bat file?

    Hey, completely new to using VB or the forums, and I was just wondering how I would go about creating a program that when executed will open the .bat file that it gets installed with and provide a text box with a section of the text inside the file so that when the user changes it there wont be room for them to accidentally delete parts of the script.
    Hope I posted this in the correct section.

  2. #2
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Re: Program to edit a section of .bat file?

    Not sure what you are getting at, but if you want to modify a .bat file, you can use the normal file IO methods in dotnet to do that. A .bat file is after all a text file.

    If you want to control what parts of the .bat file a user can or cannot change, using a .bat file may not be the right way. Please post exactly what you are trying to achieve so that others here may guide you better.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2012
    Posts
    2

    Re: Program to edit a section of .bat file?

    So what I'm doing is making a program that installs a .bat file into the start up folder so that it deletes certain log files everytime someone turns their computer on rather than manually doing it. The one problem is the directory for mine may not be the same as others, so I want people to have the option to be able to change it with a simple text box rather than having to go into the .bat file and do it manually.

  4. #4
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Program to edit a section of .bat file?

    I am assuming that you are talking about the location of the "Startup" folder may be different on each operating system? If so you can write code to check which operating system the user is using and set the path for the "Startup" folder accordingly.

    Edit:

    Also, are you using VB6 or VB.Net?
    Last edited by Nightwalker83; Dec 8th, 2012 at 09:59 PM. Reason: Adding more!
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

Posting Permissions

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



Click Here to Expand Forum to Full Width