경로 문제의 일부를 찾을 수 없습니다.

VADIVEL NATARAJAN 사용자 2505309

콘솔 응용 프로그램을 생성하고 인수를 전달하여 배치 파일을 사용하여 콘솔 응용 프로그램을 실행하려고했습니다. 배치 파일을 실행하려고 할 때 아래와 같은 오류가 발생했습니다. 그러나 명령 프롬프트에서 응용 프로그램 위치로 이동하여 인수를 전달하면 응용 프로그램이 제대로 실행됩니다.

C:\WINDOWS\system32>"C:\Users\Akgem\Desktop\Infos\Logs.exe" "1.2.0.2"
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\WIND
OWS\system32\Infos\LogInfo.log'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, I
nt32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions o
ptions, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolea
n useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean
bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean che
ckHost)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encodin
g, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalWriteAllText(String path, String contents, Encoding
 encoding, Boolean checkHost)
   at System.IO.File.WriteAllText(String path, String contents)
   at GatherLogs.Program.Logentries(String text)
   at GatherLogs.Program.Main(String[] args)

Unhandled Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\WIND
OWS\system32\Infos\LogInfo.log'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, I
nt32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions o
ptions, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolea
n useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean
bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean che
ckHost)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encodin
g, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalWriteAllText(String path, String contents, Encoding
 encoding, Boolean checkHost)
   at System.IO.File.WriteAllText(String path, String contents)
   at GatherLogs.Program.Main(String[] args)

배치 파일 내용은 다음과 같습니다.

"%~dp0Logs.exe" "1.2.0.2"
pause

누구든지 문제를 해결하도록 도와 주시겠습니까?

미리 감사드립니다.

안드레이

C:\WINDOWS\system32명령 줄에서 알 수 있듯이 현재 작업 디렉토리는 입니다. 분명히 응용 프로그램은 작업 디렉토리가 C:\Users\Akgem\Desktop\Infos\(또는 그냥 C:\Users\Akgem\Desktop) 일 것으로 예상 합니다. 따라서 프로그램을 실행하기 전에이 디렉토리로 변경해야합니다.

cd "%~dp0"
Logs.exe "1.2.0.2"

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

경로의 일부를 찾을 수 없습니다.

분류에서Dev

C # 오류 : 경로의 일부를 찾을 수 없습니다.

분류에서Dev

StreamWriter가 경로의 일부를 찾을 수 없습니다.

분류에서Dev

PDF 생성 경로의 일부를 찾을 수 없습니다.

분류에서Dev

경로의 일부를 찾을 수 없습니다 : Server.mapPath

분류에서Dev

폴더를 생성 할 수 없습니다. 'D : \'경로의 일부를 찾을 수 없습니다.

분류에서Dev

폴더를 생성 할 수 없습니다. 'D : \'경로의 일부를 찾을 수 없습니다.

분류에서Dev

'AccessibilityManagerCompat_TouchExplorationStateChangeListenerImplementor.class'경로의 일부를 찾을 수 없습니다.

분류에서Dev

Nuget.targets : 오류가 경로의 일부를 찾을 수 없습니다.

분류에서Dev

Jar가 내부 파일의 경로를 찾을 수 없습니다.

분류에서Dev

System.IO.File.Move 오류-경로의 일부를 찾을 수 없습니다.

분류에서Dev

"경로의 일부를 찾을 수 없습니다"asmx 웹 서비스

분류에서Dev

서버에서 경로 오류의 일부를 찾을 수 없습니다.

분류에서Dev

System.IO.DirectoryNotFoundException : '경로의 일부를 찾을 수 없습니다.'

분류에서Dev

Mac 용 Visual Studio에서 경로의 일부를 찾을 수 없습니다.

분류에서Dev

div 내부의 img 경로를 찾을 수 없습니다.

분류에서Dev

~ / .vimrc 파일의 경로를 찾을 수 없습니다.

분류에서Dev

~ / .vimrc 파일의 경로를 찾을 수 없습니다.

분류에서Dev

파일을 찾을 수없는 경우 Excel의 외부 링크를 강제로 끊습니다.

분류에서Dev

File.ReadAllText에서 경로의 일부를 찾을 수 없지만 경로가 있습니다.

분류에서Dev

네트워크 경로가있는 경로의 일부를 찾을 수 없습니다.

분류에서Dev

"경로의 일부를 찾을 수 없습니다"오류를 수정하는 방법

분류에서Dev

경로를 찾을 수 없습니다

분류에서Dev

파일을 삭제할 수 없습니다. 경로를 찾을 수 없음 오류를 표시합니다.

분류에서Dev

'C : \ Users \ Username \ Desktop \ GPUpdate.xlsx'경로의 일부를 찾을 수 없습니다. IE ASP.NET에서만

분류에서Dev

'$ YourPropertyHere'속성은 기본값으로 만들 수 없습니다. 오류 메시지 : % temp % 경로의 일부를 찾을 수 없습니다.

분류에서Dev

Node.js 파일을 찾을 수 없습니다. 경로 형식에 문제가 있습니까?

분류에서Dev

bazel이 내 Android sdk 경로를 제대로 찾을 수 없습니다.

분류에서Dev

XP의 ShellExecute 경로 오류-파일을 찾을 수 없습니다.

Related 관련 기사

  1. 1

    경로의 일부를 찾을 수 없습니다.

  2. 2

    C # 오류 : 경로의 일부를 찾을 수 없습니다.

  3. 3

    StreamWriter가 경로의 일부를 찾을 수 없습니다.

  4. 4

    PDF 생성 경로의 일부를 찾을 수 없습니다.

  5. 5

    경로의 일부를 찾을 수 없습니다 : Server.mapPath

  6. 6

    폴더를 생성 할 수 없습니다. 'D : \'경로의 일부를 찾을 수 없습니다.

  7. 7

    폴더를 생성 할 수 없습니다. 'D : \'경로의 일부를 찾을 수 없습니다.

  8. 8

    'AccessibilityManagerCompat_TouchExplorationStateChangeListenerImplementor.class'경로의 일부를 찾을 수 없습니다.

  9. 9

    Nuget.targets : 오류가 경로의 일부를 찾을 수 없습니다.

  10. 10

    Jar가 내부 파일의 경로를 찾을 수 없습니다.

  11. 11

    System.IO.File.Move 오류-경로의 일부를 찾을 수 없습니다.

  12. 12

    "경로의 일부를 찾을 수 없습니다"asmx 웹 서비스

  13. 13

    서버에서 경로 오류의 일부를 찾을 수 없습니다.

  14. 14

    System.IO.DirectoryNotFoundException : '경로의 일부를 찾을 수 없습니다.'

  15. 15

    Mac 용 Visual Studio에서 경로의 일부를 찾을 수 없습니다.

  16. 16

    div 내부의 img 경로를 찾을 수 없습니다.

  17. 17

    ~ / .vimrc 파일의 경로를 찾을 수 없습니다.

  18. 18

    ~ / .vimrc 파일의 경로를 찾을 수 없습니다.

  19. 19

    파일을 찾을 수없는 경우 Excel의 외부 링크를 강제로 끊습니다.

  20. 20

    File.ReadAllText에서 경로의 일부를 찾을 수 없지만 경로가 있습니다.

  21. 21

    네트워크 경로가있는 경로의 일부를 찾을 수 없습니다.

  22. 22

    "경로의 일부를 찾을 수 없습니다"오류를 수정하는 방법

  23. 23

    경로를 찾을 수 없습니다

  24. 24

    파일을 삭제할 수 없습니다. 경로를 찾을 수 없음 오류를 표시합니다.

  25. 25

    'C : \ Users \ Username \ Desktop \ GPUpdate.xlsx'경로의 일부를 찾을 수 없습니다. IE ASP.NET에서만

  26. 26

    '$ YourPropertyHere'속성은 기본값으로 만들 수 없습니다. 오류 메시지 : % temp % 경로의 일부를 찾을 수 없습니다.

  27. 27

    Node.js 파일을 찾을 수 없습니다. 경로 형식에 문제가 있습니까?

  28. 28

    bazel이 내 Android sdk 경로를 제대로 찾을 수 없습니다.

  29. 29

    XP의 ShellExecute 경로 오류-파일을 찾을 수 없습니다.

뜨겁다태그

보관