WSH

Script ランタイム、FileSystemObject、TextStream オブジェクト、Line プロパティ

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…

Script ランタイム、FileSystemObject、TextStream オブジェクト、Column プロパティ

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…

Script ランタイム、FileSystemObject、TextStream オブジェクト、AtEndOfStream プロパティ

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…

Script ランタイム、FileSystemObject、TextStream オブジェクト、AtEndOfLine プロパティ

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…

Script ランタイム、FileSystemObject、TextStream オブジェクト、WriteLine メソッド

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…

Script ランタイム、FileSystemObject、TextStream オブジェクト、WriteBlankLines メソッド

まんま 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("…

Script ランタイム、FileSystemObject、TextStream オブジェクト、Write メソッド

まんま 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…

Script ランタイム、FileSystemObject、TextStream オブジェクト、SkipLine メソッド

まんま 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…

Script ランタイム、FileSystemObject、TextStream オブジェクト、Skip メソッド

まんま 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)…

Script ランタイム、FileSystemObject、TextStream オブジェクト、ReadLine メソッド

まんま 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…

Script ランタイム、FileSystemObject、TextStream オブジェクト、ReadAll メソッド

まんま 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)…

Script ランタイム、FileSystemObject、TextStream オブジェクト、Read メソッド

まんま 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)…

Script ランタイム、FileSystemObject、TextStream オブジェクト、Close メソッド

Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.CreateTextFile("foo.txt") f.Close f.Close Close したものを再度 Close してもエラー発生しない???

Script ランタイム、FileSystemObject、Drives プロパティ

Set fso = CreateObject("Scripting.FileSystemObject") For Each d in fso.Drives WScript.Echo d Next

Script ランタイム、FileSystemObject オブジェクト、OpenTextFile メソッド

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 とはどう違う?どう使い分ける?

Script ランタイム、FileSystemObject オブジェクト、MoveFolder メソッド

Set fso = CreateObject("Scripting.FileSystemObject") fso.CreateFolder("foo") fso.MoveFolder "foo", "c:\"

Script ランタイム、FileSystemObject オブジェクト、MoveFile メソッド

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")」は良いのか〜

Script ランタイム、FileSystemObject オブジェクト、GetTempName メソッド

Set fso = CreateObject("Scripting.FileSystemObject") WScript.Echo fso.GetTempName WScript.Echo fso.GetTempName WScript.Echo fso.GetTempName 存在するファイル名を返しちゃったりしないのかな?

Script ランタイム、FileSystemObject オブジェクト、GetSpecialFolder メソッド

Set fso = CreateObject("Scripting.FileSystemObject") WScript.Echo fso.GetSpecialFolder(0) WScript.Echo fso.GetSpecialFolder(1) WScript.Echo fso.GetSpecialFolder(2)

Script ランタイム、FileSystemObject オブジェクト、GetParentFolderName メソッド

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")

Script ランタイム、FileSystemObject オブジェクト、GetFolder メソッド

Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFolder(".") WScript.Echo f WScript.Echo f.Path

Script ランタイム、FileSystemObject オブジェクト、GetFileName メソッド

Set fso = CreateObject("Scripting.FileSystemObject") WScript.Echo fso.GetFileName("foo.txt") WScript.Echo fso.GetFileName("foo\bar\baz")

Script ランタイム、FileSystemObject オブジェクト、GetFile メソッド

Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFile("2012012700.vbs") WScript.Echo f WScript.Echo f.Path

Script ランタイム、FileSystemObject オブジェクト、GetExtensionName メソッド

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")

Script ランタイム、FileSystemObject オブジェクト、GetDriveName メソッド

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…

Script ランタイム、FileSystemObject オブジェクト、GetDrive メソッド

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:") 使用できないデバイス…

Script ランタイム、FileSystemObject オブジェクト、GetBaseName メソッド

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…

Script ランタイム、FileSystemObject オブジェクト、GetAbsolutePathName メソッド

Set fso = CreateObject("Scripting.FileSystemObject") WScript.Echo fso.GetAbsolutePathName(".") WScript.Echo fso.GetAbsolutePathName("..") WScript.Echo fso.GetAbsolutePathName("..\..\..\..\..\..") どんなに上にたどっても c:\ までで止まるらし…

Script ランタイム、FileSystemObject オブジェクト、DriveExists メソッド

Set fso = CreateObject("Scripting.FileSystemObject") WScript.Echo fso.DriveExists("c") WScript.Echo fso.DriveExists("c:") コロンあってもなくても良い?

Script ランタイム、FileSystemObject オブジェクト、DeleteFolder メソッド

Set fso = CreateObject("Scripting.FileSystemObject") fso.CreateFolder("foo") fso.DeleteFolder("foo") Set f = fso.CreateTextFile("foo") f.Close fso.DeleteFolder("foo") DeleteFolder でファイルは消せないのかな?ファイルを指定しても、エラーも…