Share via

"The system cannot find the path specified." errror when invoking batch file from c#

Anonymous
2017-08-01T20:12:08+00:00

Following is the text in the batch file:


@echo off

pushd "\\x.Corp\dfs\vpmoperations\import\custodians\clientname\app"

for /f "tokens=* delims= " %%A in ('dir *.pgp /tc /b ^| find "."') do (

call :decryptfiles %%A

)

popd

goto :eof

:decryptfiles

REM If running on XP go to decryptWinXP otherwise assume we are running on windows 7

ver | find "XP" > nul

if %ERRORLEVEL% == 0 goto decryptWinXP

"C:\Program Files (x86)\Network Associates\PGP\pgp.exe" +force "\x.corp\dfs\vpmoperations\import\custodians\clientname\app%1" -p -z "pwd"

:decryptWinXP

"c:\Progra~1\Network Associates\pgp\pgp.exe" +force "\x.corp\dfs\vpmoperations\import\custodians\clientname\app%1" -p -z "pwd"

goto :eof


I get "The system cannot find the path specified." although the file exists and has been decrypted.  Any thoughts?

Windows for home | Previous Windows versions | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2017-08-02T13:57:12+00:00

    I had to comment out one line as we do not use WinXP:

    REM ver | find "XP" > nul

    That made it work. Thank you for your response Frederik Long!

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2017-08-01T20:53:38+00:00

    You need to tell us which line generates the error message.

    You also need to change this line

    if %ERRORLEVEL% == 0 goto decryptWinXP

    to

    if %ERRORLEVEL%==0 goto decryptWinXP

    or even better: replace

    ver | find "XP" > nul

    if %ERRORLEVEL% == 0 goto decryptWinXP

    with

    *ver | find "XP" > nul &&*goto decryptWinXP

    Was this answer helpful?

    0 comments No comments