Searching for ".pjx" in the registry gives the following:
Computer\HKEY_CLASSES_ROOT\.pjx (Default) REG_SZ
Visual.FoxPro.Project
Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explore
r\FileExts\.PJX\OpenWithList (Default) REG_SZ (value not
set)
Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explore
r\FileExts\.PJX\OpenWithList a REG_SZ vfp9.exe
Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explore
r\FileExts\.PJX\OpenWithList MRUList REG_SZ a
Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explore
r\FileExts\.PJX\OpenWithProgids (Default) REG_SZ (value not set)
Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explore
r\FileExts\.PJX\OpenWithProgids Visaul.FoxPro.Project REG_NONE
(zero-length binary value)
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.pjx (Default)
REG_SZ Visual.FoxPro.Project
Mike
-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of
[email protected]
Sent: Friday, January 07, 2022 4:57 PM
To: [email protected]
Subject: RE: Problem trying to run a Powershell script as an Explorer shell
command (Fox related)
Hi Mike
Could you show us what relevant entries you have in the registry - for as
long as I can remember double clicking on a PJX gives ... not an object file
Paul
Off to bed until tomorrow
-----Original Message-----
From: ProfoxTech <[email protected]> On Behalf Of Michael
Glassman
Sent: 07 January 2022 23:52
To: [email protected]
Subject: RE: Problem trying to run a Powershell script as an Explorer shell
command (Fox related)
Paul,
I'm not sure why you're having to go to such lengths. When I double-click a
PJX or PJT file in Windows Explorer, the project automatically opens up in
the project manager.
Mike
-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of
[email protected]
Sent: Friday, January 07, 2022 3:43 PM
To: [email protected]
Subject: Problem trying to run a Powershell script as an Explorer shell
command (Fox related)
Hi all
I have been toying on and off over several years with a method of opening
VFP with a MODIFY command when double-clicking a file in Explorer. For
example, double-clicking on a PJX in Explorer should open VFP with the
command MODIFY PROJECT <Project> NOWAIT.
I am almost there, maybe. At the moment everything is in C:\Temp
ConFig.FPW contains
Command = C:\Temp\FoxOpen.PRG
*FoxOpen.PRG is constructed on-the fly by a PowerShell script TEST.PS1 as
follows:
TEST.PS1
Param([string]$a)
$file=Get-Item "$a"
$Extension = $file.Extension.ToUpper()
$Command = ""
switch ($Extension)
{
.PJX
{
$Command = "Modify Project '"+ $a + "' NOWAIT"
}
# Other cases follow
}
Set-Content -Path C:\Temp\FoxOpen.PRG -Value $Command
& "C:\Program Files (x86)\Microsoft Visual FoxPro 9\vfp9.exe"
-CC:\Temp\Config.FPW
I have tested this in a PowerShell console like this
PS C:\Temp> C:\Temp\Test.PS1 <PJXPath> where <PJXPath> is a fully qualified
path to a PJX, enclosed in single quotes
I have also tested in a COMMAND window like this
C:\Temp> PowerShell C:\Temp\Test.PS1 <PJXPath> again where <PJXPath> is a
fully qualified path to a PJX, enclosed in single quotes
So far, so good. Now for how to implement the shell command. My registry
settings are as follows:
Computer\HKEY_CLASSES_ROOT
PJXFile (Default) REG-SZ Project (FoxPro)
Shell (Default) REG_SZ (value not set)
Modify project (Default) REG_SZ (value not
set)
Command (Default)
REG_SZ "POWERSHELL C:\Temp\Test1.PS1" "%1"
However, double-clicking on a PJX results in:
Windows cannot access the specified device, path or file. You may not have
the appropriate permissions to access the item.
It seems as if I am nearly there, so any suggestions will be very gratefully
received. Many thanks
Paul Newton
P.S. My first attempt at doing anything useful with PowerShell
--- StripMime Report -- processed MIME parts --- multipart/alternative
text/plain (text body -- kept)
text/html
---
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message:
https://leafe.com/archives/byMID/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.