경로에 공백이 포함된 프로그램을 실행하는 방법존경하는 커뮤니티 여러분,
Windows 10에서 JMP를 사용하여 현재 디렉터리에 있는 파일들을 압축하고 싶습니다.
그래서 저는 `run program()` 함수와 `cmd` 또는 `powershell` 명령어를 사용합니다.
OneDrive 경로에 공백이 있는데, 어떻게 해야 제대로 작동할까요?
사용자 그룹에서 https://community.jmp.com/t5/Discussions/Open-file-in-excel-with-whitespace-in-filename/mp/911999?search-action-id=96030372702&search-result-uid=911999 링크를 찾았지만 도움이 되지 않았습니다.
감사해요!
Names Default To Here( 1 );
base_path = Get Default Directory(); // doesn't work
base_path = "C:\Users\"; // works
Show( base_path );
// e.g. base_path = "/C:/Users/user/OneDrive - Documents/";
// how to mask space in path??
command = Eval Insert( "dir ^base_path^" );
// command = eval insert("\[dir "^base_path^"]\"); // doesn't work
Show( command );
RP = Run Program(
Executable( "cmd.exe" ),
Options( Insert( {"/a", "/q", "/c"}, command ) ),
// ReadFunction( Function( {this}, Write( this << read ) ) )
readfunction( "Text" )
);
자동화 및 스크립팅Re: 경로에 공백이 있는 프로그램을 실행하는 방법경로에 따옴표를 추가하면 해결될 것입니다.
Names Default To Here(1);
base_path = "C:\Program Files\"; // works
Show(base_path);
command = Eval Insert("dir \!"^base_path^\!"");
Show(command);
RP = Run Program(
Executable("cmd.exe"),
Options(Insert({"/a", "/q", "/c"}, command)),
// ReadFunction( Function( {this}, Write( this << read ) ) )
readfunction("Text")
);
Re: 경로에 공백이 있는 프로그램을 실행하는 방법안녕하세요, 야르모님. 감사합니다. 말씀하신 대로 저도 시작 부분의 역슬래시 때문에 문제가 있었네요.
Names Default To Here( 1 );
base_path = "C:\Program Files\"; // works
base_path = Get Default Directory();
// starting backslash makes problems, needs to be removed
// "/C:/Users/
<USER>
/OneDrive - Documents/" base_path = Substr( base_path, 2, Length( base_path ) ); command = Eval Insert( "dir \!"^base_path^\!"" ); Show( command ); RP = Run Program( Executable( "cmd.exe" ), Options( Insert( {"/a", "/q", "/c"}, command ) ), // ReadFunction( Function( {this}, Write( this << read ) ) ) readfunction( "Text" ) );
</USER>
Re: 경로에 공백이 있는 프로그램을 실행하는 방법첫 번째 백슬래시를 제거하려면 "windows" 인수를 사용하여 Convert File Path() 함수를 사용하면 됩니다.
Names Default To Here(1);
base_path = Get Default Directory();
base_path_w = Convert File Path(base_path, "windows"); // "C:\Users\
<USERNAME>
\Documents\"
</USERNAME>