Results 1 to 4 of 4

Thread: [RESOLVED] creating .bat file in vb

  1. #1

    Thread Starter
    Fanatic Member dark_shadow's Avatar
    Join Date
    Feb 2005
    Location
    Igloo
    Posts
    900

    Resolved [RESOLVED] creating .bat file in vb

    i'm using the following code to create a bat file in vb
    VB Code:
    1. Dim ff
    2. on error goto er:
    3.  ff = FreeFile
    4.  Open "exp.bat" For Output As #ff
    5.  Print #ff, "At" & " " & timee & " " & "/interactive" & " " & "cmd.exe"
    6.  Close #ff
    7. er:
    8.  MsgBox (err.Description)
    9.  MsgBox (err.Number)
    but its generating some sort of error but it gives me a blank error decription and a err number of 0 i think there's somthing basic i'm missing but i cant figure it out :S one of those times where your having a blank out lol

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: creating .bat file in vb

    no , its because you arent exiting the sub/function

    VB Code:
    1. Dim ff
    2. on error goto er:
    3.  ff = FreeFile
    4.  Open "exp.bat" For Output As #ff
    5.  Print #ff, "At" & " " & timee & " " & "/interactive" & " " & "cmd.exe"
    6.  Close #ff
    7.  Exit Sub 'or Exit Function
    8. er:
    9.  Msgbox Err.Number & " - " & Err.Description
    if you dont exit it will always hit the msgboxes
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Fanatic Member dark_shadow's Avatar
    Join Date
    Feb 2005
    Location
    Igloo
    Posts
    900

    Re: creating .bat file in vb

    alright for some reason now its not creating the bat file :S

  4. #4

    Thread Starter
    Fanatic Member dark_shadow's Avatar
    Join Date
    Feb 2005
    Location
    Igloo
    Posts
    900

    Re: creating .bat file in vb

    never mind i figured it out thanks for the help

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