Run Powershell Script from FreeCommanderXE get different result than running from Windows Explorer

Discussion, questions and support.
Post Reply
Message
Author
ZoltanZen
Posts: 5
Joined: 02.10.2019, 08:35

Run Powershell Script from FreeCommanderXE get different result than running from Windows Explorer

#1 Post by ZoltanZen » 23.02.2023, 08:39

Hello,

I would like to ask why get I different result if I run powershell script from FreecommanderXE than from Windows Explorer.

The PowerShell script, and location (C:\Test\powershell.ps1)

Code: Select all

$curDir = Get-Location
write-host "$curDir"
$a = Read-Host
If I am running this script from FreeCommanderXE:
Result:

Code: Select all

C:\Programok\FreeCommanderXE
This is the program folder.

If I am running this script from File Explorer:
Result:

Code: Select all

C:\Test
Why is the difference? How can I manage to the running script get the same as the File Explorer?

Thanks your answers,
Zoltán
Last edited by ZoltanZen on 28.02.2023, 07:42, edited 1 time in total.

ZoltanZen
Posts: 5
Joined: 02.10.2019, 08:35

Re: Run Powershell Script from FreeCommanderXE get different result than running from Windows Explorer

#2 Post by ZoltanZen » 27.02.2023, 15:52

So this is a simple PowerShell script, what is get the current folder, and write it to console:

Code: Select all

$curDir = Get-Location
write-host "$curDir"
$a = Read-Host
And this is happenning when I run it:
Image
Why is the difference? How can I manage to the running script get the same as the File Explorer?
Last edited by ZoltanZen on 28.02.2023, 07:42, edited 1 time in total.


ZoltanZen
Posts: 5
Joined: 02.10.2019, 08:35

Re: Run Powershell Script from FreeCommanderXE get different result than running from Windows Explorer

#4 Post by ZoltanZen » 28.02.2023, 07:35

Marek wrote: 27.02.2023, 20:45 It works fine with the 64 bit version.
I am using FreeCommander XE 2023 Build 880 32-bit public. Could you test it in this version?

User avatar
Forez
Posts: 1312
Joined: 30.01.2016, 12:05
Location: In front of a PC monitor

Re: Run Powershell Script from FreeCommanderXE get different result than running from Windows Explorer

#5 Post by Forez » 09.03.2023, 16:21

Maybe also there is a difference of privileges?

Check under

Task Manager > Details > Elevated

if both explorer.exe and FreeCommander.exe are either YES or NO. If they are not on the same level- then this could be the culprit

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests