none
Get error file not on the path RRS feed

  • Question

  • I have been running PSEXEC on computer A to initiate a backup of computer B This is the code:

    c:\windows\System32\psexec \\main -h -f -accepteula -u main\phil -p xxx -c "c:\users\phil\documents\backup\Main_Image\EX_Main_Imagebackup to shop.bat"

    This program has been running fine for 2 years.

    Recently I tried to run another psexec program on computer A to retrieve log info from computer B this is the code:

    c:\windows\System32\psexec \\main -h -f -accepteula -u main\phil -p xxx -c c:\users\phil\documents\backup\Log_Enable_Main.bat

    I keep getting the error "The specified application is not on the path. As I understand it if I use the -c command the application doesn't need to be on the path because computer A sends the application to computer B. As you can see the two scripts above are nearly identical.

    What am I missing

    azidct

    Wednesday, November 20, 2019 10:03 PM

Answers

  • I ran procmon and stumbled across an error on a line inside Log_Eanble_main.bat

    The line was:

    hostname >>shop\c:\users\phil\documents\backup\logenable.log

    I retyped that line but forgot to put in C:\

    hostname >>shop\users\phil\documents\backup\logenable.log

    The error in procmon was improper syntax. I wasn't sure what that meant but the second line ran ok. Not sure why . Also the original error not being on the path was misleading. Any way all is well now.

    thanks

    azidct

    • Marked as answer by azidct Saturday, November 23, 2019 7:02 PM
    Saturday, November 23, 2019 7:02 PM

All replies

  • The best thing you can do to understand what the problem is, is to run Procmon on the computer B while executing the command on computer A.

    Using the -c option.

     Copy the specified program to the remote system for
                    execution. If you omit this option the application
                    must be in the system path on the remote system.

    So this means that c:\users\phil\documents\backup\Log_Enable_Main.bat is in that path on computer A, and PSexec will copy Log_Enable_main.bat to C:\windows\SYstem32 of Computer B.

    What is inside Log_Enable_Main.bat?? If it call some exe that is not on the remote \windows\system32 it won't works..

    Take a trace with Procmon and you will see immediately what's wrong and what's missing..

    HTH
    -mario

     

    Wednesday, November 20, 2019 11:00 PM
  • I will give procmon a try. I haven't used it in a long time.
    • Marked as answer by azidct Saturday, November 23, 2019 6:42 PM
    • Unmarked as answer by azidct Saturday, November 23, 2019 6:43 PM
    Wednesday, November 20, 2019 11:55 PM
  • I ran procmon and stumbled across an error on a line inside Log_Eanble_main.bat

    The line was:

    hostname >>shop\c:\users\phil\documents\backup\logenable.log

    I retyped that line but forgot to put in C:\

    hostname >>shop\users\phil\documents\backup\logenable.log

    The error in procmon was improper syntax. I wasn't sure what that meant but the second line ran ok. Not sure why . Also the original error not being on the path was misleading. Any way all is well now.

    thanks

    azidct

    • Marked as answer by azidct Saturday, November 23, 2019 7:02 PM
    Saturday, November 23, 2019 7:02 PM