Sub Sample() Dim n As Integer, m As Integer, buf As String n = FreeFile '1を返します Open "c:\autoexec.bat" For Input As n Line Input #n, buf m = FreeFile '2を返します Open "C:\Test.txt" For Output As m Print #m, buf Close m Close n End Sub