Scripting Network Shares

Things you’d like to miss in the future...
Forum rules
:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:

:info: Please include the following information:
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".

:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:
Post Reply
EnjoyRC
Posts: 101
Joined: 08 Nov 2010 21:54

Scripting Network Shares

Post by EnjoyRC »

If I use a script in a catagory entry to set the 2 panes. All looks great. But if I exit XY and reopen it, I get an error in Pane #2. (see below)
If I manually navigate the left and right panes, I can close and open XY all I want without errors.

Code: Select all

    $p = get("#800", "DP", "SP");
    if $p == "SP" {
        #800;  //Toggle Dual Panes
    }
    focus p2;
    goto "\\servername\folder\videofiles";
    sortby Mod, d;
    focus p1;
    goto "%userprofile%\Videos";
    sortby Name, a;
Error:
Location currently not available
\\servername\folder\videofiles\

Also, if I choose the "Go Up" option from that scripted tab, it jumps to \\servername, instead of \\servername\folder.
Last edited by EnjoyRC on 16 Nov 2010 16:38, edited 1 time in total.

admin
Site Admin
Posts: 66351
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Scripting Network Shares

Post by admin »

You say "If I use a script in a catagory entry to set the 2 panes. ..." Are you sure that this is a necessary prerequisite to produce the bug? What if you set the panes locations manually?

EnjoyRC
Posts: 101
Joined: 08 Nov 2010 21:54

Re: Scripting Network Shares

Post by EnjoyRC »

admin wrote:You say "If I use a script in a catagory entry to set the 2 panes. ..." Are you sure that this is a necessary prerequisite to produce the bug? What if you set the panes locations manually?
As mentioned in the last line
If I manually navigate the left and right panes, I can close and open XY all I want without errors

admin
Site Admin
Posts: 66351
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Scripting Network Shares

Post by admin »

EnjoyRC wrote:As mentioned in the last line
If I manually navigate the left and right panes, I can close and open XY all I want without errors
Oh, yes. :roll: I'll check that.

admin
Site Admin
Posts: 66351
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Scripting Network Shares

Post by admin »

Cannot reproduce.

Since you note the difference at startup, there must be a crucial difference in the configuration files depending on the method (script or manual navigation) after you close the app. Probably in XYplorer.ini or in either of <xydata>\panes\pane.ini. Can you spot that difference?

EnjoyRC
Posts: 101
Joined: 08 Nov 2010 21:54

Re: Scripting Network Shares

Post by EnjoyRC »

Can you believe it? Today it's working. :shock: I'll keep an eye on it and if it does it again, I'll check the INI file.

Edit: Sort of working. There is still the issue of "Go Up". When browsing a network share, no matter how deep you are, if you use the "Go Up" action it sends you all the way back to the root instead of simply the parent folder.

Example....
\\server\share\data\folder\deep folder\
[Go Up]
\\server

I anticipated it to go to \\server\share\data\folder\

EnjoyRC
Posts: 101
Joined: 08 Nov 2010 21:54

Re: Scripting Network Shares

Post by EnjoyRC »

Error is back.. gonna try and share differences in the pane.ini files. Just posting the sections that differ. Otherwise they all match.

Bad INI file:

Code: Select all

[ListNetwork]
Sort=-65536
Num=0
Style=1079
View=0
Date=0
Time=0
Age=0
Day=0
Visible=11
Columns=.200,.200

[Tabs]
Version=3
LastTab=0
MRU=A
Count=1
I1=1
C1=
D1=\\servername\folder\videofiles
A1=	0	Name.175,Ext.32,Size.52,Type.80,Modified.115,Created.115,Accessed.115,Attr.47,Len.28,Tag.50,Comment.75,	-32763	\\servername\folder\videofiles\FullDisc			0	0			Computer	11111100000	1079
H1=
M1=

[History]
Count=2
Cur=2
1=Computer
1t=1
2=\\servername\folder\videofiles
2t=1
Good INI file:

Code: Select all

[ListNetwork]
Sort=-65536
Num=0
Style=1079
View=0
Date=0
Time=0
Age=0
Day=0
Visible=11
Columns=Name.200,Comments.200,

[Tabs]
Version=3
LastTab=0
MRU=A
Count=1
I1=1
C1=
D1=\\servername\folder\videofiles
A1=	0	Name.175,Ext.32,Size.52,Type.80,Modified.115,Created.115,Accessed.115,Attr.47,Len.28,Tag.50,Comment.75,	-32763	+\\servername\folder\videofiles\advertisement.iso			0	0			C:\Users\mark\Videos\	11111100000	1079
H1=
M1=

[History]
Count=6
Cur=6
1=Computer
1t=1
2=\\servername\folder\videofiles
2t=1
3=\\servername\folder\videofiles
3t=1
4=\\servername\
4t=1
5=\\servername\folder
5t=1
6=\\servername\folder\videofiles
6t=1
Good INI is from manually browsing to the directory. Bad INI is set from a script. The [Tab] area seems different. The bad INI contains "\\servername\folder\videofiles\FullDisc". The FullDisc folder is on Pane 1. How is Pane 2's INI file picking up a folder from Pane 1? For my test, Pane 1 was pointing to C:\Users\mark\Videos\ and had a FullDisc subdirectory in it's listing.

I think i'm getting close to it here. Hope this helps.

admin
Site Admin
Posts: 66351
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Scripting Network Shares

Post by admin »

See the little "+" here: +\\servername\folder\videofiles

Try to add it to the BAD ini manually and see if it makes it a GOOD ini.

EnjoyRC
Posts: 101
Joined: 08 Nov 2010 21:54

Re: Scripting Network Shares

Post by EnjoyRC »

The + didn't do it... but it's that same path that is invalid

Code: Select all

\\servername\folder\videofiles\FullDisc
FullDisc isn't a subdirectory of videofiles. FullDisc is a subfolder in Pane #1. Is it somehow pulling that from Pane 1?

EnjoyRC
Posts: 101
Joined: 08 Nov 2010 21:54

Re: Scripting Network Shares

Post by EnjoyRC »

Just did another test.. looks like for it to work, it needs to have the + before the UNC and the path includes some file selected in the pane.

+\\server\share\data\filename.txt

EnjoyRC
Posts: 101
Joined: 08 Nov 2010 21:54

Re: Scripting Network Shares

Post by EnjoyRC »

I Got It !!!!!! If I use the script in the first post of this thread... and.... then I click a file in the left pane, and click a file in the right pane. Then exit. ALL WORKS. It's the fact that a script has the ability to GoTo a path without selecting a file in that pane. So if you exit XY, it corrupts the path info for that pane. (Disregard this.... even after clicking a file in each pane, it could come back with an error)

If you manually browse, an file entry is always selected for you. That's why manual browsing works all the time. Then once a file entry is selected there's NO way to unbox one of the entries in that list.

Addon: I also tried using a script that set Pane 1 to a C: path, and Pane 2 to a D: path. Both local drives. Exited. Reopened. That worked fine. Seems to be associated to Network paths.

New Test: I used the script from the first post here. It populated the 2 panes. I then swapped the panes and exited. Reopened... and guess what... all works. So swapping the panes updates something.

Hope all this helps.
Last edited by EnjoyRC on 16 Nov 2010 19:18, edited 3 times in total.

EnjoyRC
Posts: 101
Joined: 08 Nov 2010 21:54

Re: Scripting Network Shares

Post by EnjoyRC »

Adding 'sel' statements to the code didn't help.

Code: Select all

    $p = get("#800", "DP", "SP");
    if $p == "SP" {
        #800;  //Toggle Dual Panes
    }
    focus p2;
    goto "\\server\support\videos";
    sortby Mod, d;
    sel 1;   //select first item
    focus p1;
    goto "%userprofile%\Videos";
    sortby Name, a;
    sel 1;   //select first item

admin
Site Admin
Posts: 66351
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Scripting Network Shares

Post by admin »

I'll check that tomorrow, thanks.

admin
Site Admin
Posts: 66351
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Scripting Network Shares

Post by admin »

EnjoyRC wrote:I Got It !!!!!! If I use the script in the first post of this thread... and.... then I click a file in the left pane, and click a file in the right pane. Then exit. ALL WORKS. It's the fact that a script has the ability to GoTo a path without selecting a file in that pane. So if you exit XY, it corrupts the path info for that pane. (Disregard this.... even after clicking a file in each pane, it could come back with an error)
Do I get you right that the "Disregard this..." part invalidates the "I Got It !!!!!!" part?

Whatever, I cannot reproduce it. Mysterious! :? I still doubt that the script is a necessary conditions for this.

EnjoyRC
Posts: 101
Joined: 08 Nov 2010 21:54

Re: Scripting Network Shares

Post by EnjoyRC »

admin wrote:Do I get you right that the "Disregard this..." part invalidates the "I Got It !!!!!!" part?
Yes, you got it right... it started acting up again, even when clicking an entry. The problem mostly seems to be due to using UNCs.

Post Reply