フォルダ内のすべてのファイルを削除するには?フォルダーにはフォルダーは含まれませんが、複数のファイルが含まれます。
JSLを使用してこれらのファイルを削除するにはどうすればよいですか?
このフォルダは他のレベルによって占有されているため、フォルダを削除しても達成できません。
rd1=Delete Directory(dir);rc1=Create Directory(dir);
ありがとう!
スクリプティングウィンドウズRe: フォルダ内のすべてのファイルを削除するには?私にとっては、ディレクトリにファイルがあっても削除されます。 ファイルの一部がまだ使用されている可能性がありますか?
Names Default To Here(1);
dir_path = "$TEMP\test\";
If(!Directory Exists(dir_path),
Create Directory(dir_path);
new_file = Save Text File(dir_path || "DeleteMe.txt", "The quick brown fox");
new_file = Save Text File(dir_path || "DeleteMe2.txt", "The quick brown fox");
);
wait(1);
Show(Directory Exists(dir_path));
Show(Files In Directory(dir_path));
Show(File Exists(new_file));
Delete Directory(dir_path);
wait(1);
Show(File Exists(new_file));
Show(Directory Exists(dir_path));
Re: フォルダ内のすべてのファイルを削除するには?ファイルを削除するだけの場合は、次の変更があります@jthiそれを行うためのコード
Names Default To Here( 1 );
dir_path = "$TEMP\test\";
If( !Directory Exists( dir_path ),
Create Directory( dir_path );
new_file = Save Text File(
dir_path || "DeleteMe.txt",
"The quick brown fox"
);
new_file = Save Text File(
dir_path || "DeleteMe2.txt",
"The quick brown fox"
);
);
Wait( 1 );
// Get the files in the folder
the_Files = Files In Directory( dir_path );
For Each( {file}, the_files, rc = Delete File( dir_path || file ) );
Show( Files In Directory( dir_path ) );Re: フォルダ内のすべてのファイルを削除するには?ありがとう!
Windows 7 が使えなくなりました。
必ず JMP 16 を使用してください。
強力な For Each()
For Each( {file}, the_files, rc = Delete File( dir_path || file ) );