WSH
Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.WriteLine "Hello world!" f.WriteLine "HELLO WORLD!" Set f = fso.OpenTextFil…
Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.WriteLine "Hello world!" f.WriteLine "HELLO WORLD!" Set f = fso.OpenTextFil…
Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.WriteLine "Hello world!" Set f = fso.OpenTextFile("foo.txt", ForReading) Do…
Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.WriteLine "Hello world!" f.WriteLine "HELLO WORLD!" Set f = fso.OpenTextFil…
Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.WriteLine "Hello world!" f.WriteLine "HELLO WORLD!" Set f = fso.OpenTextFil…
まんま Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.WriteBlankLines(2) f.Write "Hello world!" Set f = fso.OpenTextFile("…
まんま Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.Write "Hello world!" & vbCrLf f.Write "HELLO WORLD!" Set f = fso.Ope…
まんま Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.WriteLine "Hello world!" f.WriteLine "HELLO WORLD!" Set f = fso.Open…
まんま Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.Write "Hello world!" Set f = fso.OpenTextFile("foo.txt", ForReading)…
まんま Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.WriteLine "Hello world!" f.WriteLine "HELLO WORLD!" Set f = fso.Open…
まんま Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.Write "Hello world!" Set f = fso.OpenTextFile("foo.txt", ForReading)…
まんま Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.Write "Hello world!" Set f = fso.OpenTextFile("foo.txt", ForReading)…
Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.CreateTextFile("foo.txt") f.Close f.Close Close したものを再度 Close してもエラー発生しない???
Set fso = CreateObject("Scripting.FileSystemObject") For Each d in fso.Drives WScript.Echo d Next
Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("foo.txt", ForWriting, True) f.WriteLine("Hello!") f.Close CreateTextFile とはどう違う?どう使い分ける?
Set fso = CreateObject("Scripting.FileSystemObject") fso.CreateFolder("foo") fso.MoveFolder "foo", "c:\"
Set fso = CreateObject("Scripting.FileSystemObject") WScript.Echo fso.MoveFile("foo", "bar") 'fso.MoveFile "bar", "foo" 「fso.MoveFile("foo", "bar")」はダメでも、「WScript.Echo fso.MoveFile("foo", "bar")」は良いのか〜
Set fso = CreateObject("Scripting.FileSystemObject") WScript.Echo fso.GetTempName WScript.Echo fso.GetTempName WScript.Echo fso.GetTempName 存在するファイル名を返しちゃったりしないのかな?
Set fso = CreateObject("Scripting.FileSystemObject") WScript.Echo fso.GetSpecialFolder(0) WScript.Echo fso.GetSpecialFolder(1) WScript.Echo fso.GetSpecialFolder(2)
Set fso = CreateObject("Scripting.FileSystemObject") WScript.Echo fso.GetParentFolderName(".") WScript.Echo fso.GetParentFolderName("foo.txt") WScript.Echo fso.GetParentFolderName("..") WScript.Echo fso.GetParentFolderName("c:\foo\bar\baz")
Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFolder(".") WScript.Echo f WScript.Echo f.Path
Set fso = CreateObject("Scripting.FileSystemObject") WScript.Echo fso.GetFileName("foo.txt") WScript.Echo fso.GetFileName("foo\bar\baz")
Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFile("2012012700.vbs") WScript.Echo f WScript.Echo f.Path
Set fso = CreateObject("Scripting.FileSystemObject") WScript.Echo fso.GetExtensionName(".") WScript.Echo fso.GetExtensionName("foo.c") WScript.Echo fso.GetExtensionName("foo.c.d") WScript.Echo fso.GetExtensionName("c:\bar\foo.c")
Set fso = CreateObject("Scripting.FileSystemObject") WScript.Echo fso.GetDriveName("c") ' 空白に WScript.Echo fso.GetDriveName("c:") WScript.Echo fso.GetDriveName("c:\") WScript.Echo fso.GetDriveName("c:\foo") WScript.Echo fso.GetDriveName…
Set fso = CreateObject("Scripting.FileSystemObject") WScript.Echo fso.GetDrive("c") WScript.Echo fso.GetDrive("c:") WScript.Echo fso.GetDrive("c:\") 'WScript.Echo fso.GetDrive("c:\foo") 'WScript.Echo fso.GetDrive("y:") 使用できないデバイス…
Set fso = CreateObject("Scripting.FileSystemObject") WScript.Echo fso.GetBaseName(".") WScript.Echo fso.GetBaseName("..") WScript.Echo fso.GetBaseName("2012012300.vbs") WScript.Echo fso.GetBaseName(".\2012012300.vbs") WScript.Echo fso.GetB…
Set fso = CreateObject("Scripting.FileSystemObject") WScript.Echo fso.GetAbsolutePathName(".") WScript.Echo fso.GetAbsolutePathName("..") WScript.Echo fso.GetAbsolutePathName("..\..\..\..\..\..") どんなに上にたどっても c:\ までで止まるらし…
Set fso = CreateObject("Scripting.FileSystemObject") WScript.Echo fso.DriveExists("c") WScript.Echo fso.DriveExists("c:") コロンあってもなくても良い?
Set fso = CreateObject("Scripting.FileSystemObject") fso.CreateFolder("foo") fso.DeleteFolder("foo") Set f = fso.CreateTextFile("foo") f.Close fso.DeleteFolder("foo") DeleteFolder でファイルは消せないのかな?ファイルを指定しても、エラーも…