Path

構文
Folder.Path
引数
戻値

プログラム実行例

一時ファイルを作成・削除

CONST TemporaryFolder = 2

DIM FSO = CREATEOLEOBJ("Scripting.FileSystemObject")
DIM Folder = FSO.GetSpecialFolder(TemporaryFolder)
DIM path = Folder.Path
DIM name = FSO.GetTempName
path = FSO.BuildPath(path, name)

PRINT path

DIM TextStream = FSO.CreateTextFile(path)
// 現在の日時をファイルに書き込む
TextStream.WriteLine(now())
TextStream.Close

// Tempファイルを削除
// FSO.DeleteFile(path)

FUNCTION now()
	GETTIME()
	RESULT = G_TIME_YY4 + "/" + G_TIME_MM2 + "/" + G_TIME_DD2 + " " + G_TIME_HH2 + ":" + G_TIME_NN2
FEND
  1. script.function.CREATEOLEOBJ(3)
  2. com.FSO.GetSpecialFolder(4)
  3. com.FSO.Folder.Path(5)
  4. com.FSO.GetTempName(6)
  5. com.FSO.BuildPath(7)
  6. com.FSO.CreateTextFile(11)
  7. com.FSO.TextStream(11)
  8. com.FSO.TextStream.WriteLine(13)
  9. com.FSO.TextStream.Close(14)
  10. com.FSO.DeleteFile(17)
結果
D:\TMP\rad83BB3.tmp

csvファイルをHTMLのテーブルデータにする(csvToHTML)

CSVのデータをHTML(テーブル)に変換します。

クリップボードにcsvファイルのパスをコピーして実行します。

CONST TemporaryFolder = 2

DIM FSO = CREATEOLEOBJ("Scripting.FileSystemObject")
DIM Folder = FSO.GetSpecialFolder(TemporaryFolder)
DIM folderspec = Folder.Path
DIM name = FSO.GetTempName
DIM TempPath = FSO.BuildPath(folderspec, name)

DIM path = GETSTR(0)
DIM FID = FOPEN(path, F_READ)
DIM FID2 = FOPEN(TempPath, F_READ OR F_WRITE)
FPUT(FID2, "", F_ALLTEXT)

FOR row = 1 TO FGET(FID, F_LINECOUNT)
	DIM col = 1
	FPUT(FID2, "<#TAB>", 0)
	WHILE FGET(FID, row, col) <> ""
		FPUT(FID2, "<#TAB><#TAB>", 0)
		col = col + 1
	WEND
	FPUT(FID2, "<#TAB>", 0)
NEXT
FPUT(FID2,"
" + (FGET(FID, row, col)) + "
", 0) FCLOSE(FID) FCLOSE(FID2) FID = FOPEN(TempPath, F_READ) SENDSTR(0, FGET(FID, F_ALLTEXT)) PRINT FGET(FID, F_ALLTEXT) FCLOSE(FID)
  1. script.function.CREATEOLEOBJ(3)
  2. com.FSO.GetSpecialFolder(4)
  3. com.FSO.Folder.Path(5)
  4. com.FSO.GetTempName(6)
  5. com.FSO.BuildPath(7)
  6. script.function.GETSTR(9)
  7. script.function.FOPEN(10,11,28)
  8. script.function.FPUT(12,16,18,21,23)
  9. script.function.FGET(14,30)
  10. script.function.FCLOSE(25,26,31)
  11. script.function.SENDSTR(29)

Tempフォルダのパスを取得

CONST TemporaryFolder = 2

DIM FSO = CREATEOLEOBJ("Scripting.FileSystemObject")
DIM Folder = FSO.GetSpecialFolder(TemporaryFolder)

PRINT Folder.Path
  1. script.function.CREATEOLEOBJ(3)
  2. com.FSO.GetSpecialFolder(4)
  3. com.FSO.Folder.Path(6)
結果
D:\TMP

フォルダ内の情報を表示

CONST TemporaryFolder = 2

DIM FSO = CREATEOLEOBJ("Scripting.FileSystemObject")
DIM Folder = FSO.GetSpecialFolder(TemporaryFolder)

WITH Folder
	PRINT "名前<#TAB><#TAB>" + .Name
	PRINT "親フォルダパス<#TAB>" + .ParentFolder.Path
	PRINT "パス<#TAB><#TAB>" + .Path
	PRINT "短い名前<#TAB>" + .ShortName
	PRINT "短いパス<#TAB>" + .ShortPath
ENDWITH
  1. script.function.CREATEOLEOBJ(3)
  2. com.FSO.GetSpecialFolder(4)
  3. script.syntax.WITH(6)
  4. com.FSO.Folder.Name(7)
  5. com.FSO.Folder.Path(Ζ,9])
結果
名前 TMP
親フォルダパス D:\
パス D:\TMP
短い名前 TMP
短いパス D:\TMP