[RESOLVED] creating .bat file in vb
i'm using the following code to create a bat file in vb
VB Code:
Dim ff
on error goto er:
ff = FreeFile
Open "exp.bat" For Output As #ff
Print #ff, "At" & " " & timee & " " & "/interactive" & " " & "cmd.exe"
Close #ff
er:
MsgBox (err.Description)
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
Re: creating .bat file in vb
no , its because you arent exiting the sub/function
VB Code:
Dim ff
on error goto er:
ff = FreeFile
Open "exp.bat" For Output As #ff
Print #ff, "At" & " " & timee & " " & "/interactive" & " " & "cmd.exe"
Close #ff
Exit Sub 'or Exit Function
er:
Msgbox Err.Number & " - " & Err.Description
if you dont exit it will always hit the msgboxes
Re: creating .bat file in vb
alright for some reason now its not creating the bat file :S
Re: creating .bat file in vb
never mind i figured it out thanks for the help :wave: