Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

Advertisement

SmurfnSurf
Joined:
Posts:
4

Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

Background: I use to have WinSCP Portable in C:\Utils\WinSCP, for many years.

I wanted to use the Search TEXT within files feature, via the built-in extension, so I installed WinSCP Windows Installer in Win11 "for everyone" and selected the custom install, to the C:\Utils\WinSCP dir, not the default dir.

I then ran the Commands > Static Custom Commands > Search for Text Extension.

PowerShell window comes up, searches, finds my text (simply QTPi4Eth in *.* from root on an Asus Router), continues 3 more lines then I get this error below (User Redacted to XXXXXX).

I have searched the forum but cannot find a similar instance that has been answered and solved. How can I help you troubleshoot this please?

File /data/boot_state_0 matches mask, searching contents...
File /data/scratchpad matches mask, searching contents...
File /debug matches mask, searching contents...
Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access to the path
'C:\Users\XXXXXXX\AppData\Local\Temp\debug' is denied.
At C:\Utils\WinSCP\Extensions\SearchText.WinSCPextension.ps1:78 char:30
+ ...         $matchInfo = Select-String -Path $tempPath -SimpleMatch $text
+                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Select-String], ArgumentException
    + FullyQualifiedErrorId : ProcessingFile,Microsoft.PowerShell.Commands.SelectStringCommand

Confirm
The item at C:\Users\XXXXXXX\AppData\Local\Temp\debug has children and the Recurse parameter was not specified. If you
 continue, all children will be removed with the item. Are you sure you want to continue?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):
Thank you!

Error.jpg

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,852
Location:
Prague, Czechia

Re: Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

Is the /debug a file or a directory?

Reply with quote

SmurfnSurf

Re: Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

I’m pretty sure it’s a debug file generated by the router, so I think I see where you are going with the observation as it’s constantly growing/ being updated.

How do I exclude that file from the search?

Reply with quote

martin
Site Admin
martin avatar

Re: Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

No that's not where I'm heading. I believe it's a directory, not a file. Can you check?

Reply with quote

Guest

Re: Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

Hi again,

You're correct; it is a directory (on an ASUS Rt-AX88U Pro Router).
See attached. HTH?

Description: Contents of Slash Debug

Contents of Slash_Debug.jpg

Description: Debug Dir

Slash_Debug.jpg

Reply with quote

Advertisement

SmurfnSurf
Joined:
Posts:
4

Re: Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

See attached. I used Debug level 2.
I attach 3 logs, as the first one (Where I answered N to continue after the error, see picture) does not seem to have a lot, the other two more detail (I answered Y to continue and got a second error too).

Description: Error1 showing continue questions below it

Error1.jpg

Description: Debug Level

Logging.jpg

Description: Zip file with 3 logs

Reply with quote

SmurfnSurf
Joined:
Posts:
4

Re: Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

martin wrote:

Thanks. Though you have enabled logging for the main GUI session. I've asked for log from the extension.
Go to: https://winscp.net/eng/docs/ui_pref_commands
Select the extension and click //Configure//.

Sorry abouut that, steep learning curve!
Hopefully this is what you needed?
Description: Searchtext Log

Reply with quote

Advertisement

You can post new topics in this forum