StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Sherif Aliti  
#1 Posted : Sunday, May 26, 2024 11:08:01 AM(UTC)
Sherif Aliti

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 2/16/2021(UTC)
Posts: 45
Albania
Location: Fier

Thanks: 28 times
Was thanked: 1 time(s) in 1 post(s)
Is it possible to open the application from the folder via a shortcut if the name of the application changes?

For example, we created a shortcut "U" for an application named "2024-28-12." Later, we received an update in the same folder with the new name "2024-30-12." Is it possible for the shortcut "U" to call the latest version in that folder?

Thanks

Edited by user Tuesday, May 28, 2024 9:51:32 AM(UTC)  | Reason: Not specified

Rob  
#2 Posted : Sunday, May 26, 2024 11:50:00 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,382
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 431 time(s) in 364 post(s)
If the folder names will always be alphabetical, this will get the last folder sorted by name:
Code:
var lastDirectory = new System.IO.DirectoryInfo("C:\\Temp").EnumerateDirectories().OrderBy("Name desc").First();
StrokesPlus.Console.Log(lastDirectory.Name);
thanks 1 user thanked Rob for this useful post.
Sherif Aliti on 5/27/2024(UTC)
Sherif Aliti  
#3 Posted : Monday, May 27, 2024 8:10:30 AM(UTC)
Sherif Aliti

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 2/16/2021(UTC)
Posts: 45
Albania
Location: Fier

Thanks: 28 times
Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: Rob Go to Quoted Post
If the folder names will always be alphabetical, this will get the last folder sorted by name:
Code:
var lastDirectory = new System.IO.DirectoryInfo("C:\\Temp").EnumerateDirectories().OrderBy("Name desc").First();
StrokesPlus.Console.Log(lastDirectory.Name);




I think you misunderstood my question. I want to execute an application from a folder even if the name changes.

For example, we created a stroke to execute an application named "name 1." After an update, the application's name changes to "name 2." Can we use the same stroke to call "name 2" without changing anything in the settings?

Is there any script to detect the name change according to the date and use the latest name for that stroke?

Thanks.

Rob  
#4 Posted : Monday, May 27, 2024 9:57:25 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,382
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 431 time(s) in 364 post(s)
I was thinking the EXE was versioned by folder names, but it sounds like the EXE itself is what name changes?

Can you give me the full path and file name of the EXE before and after it is updated? That way I can fully visualize what changes and how it's being used.



thanks 1 user thanked Rob for this useful post.
Sherif Aliti on 5/27/2024(UTC)
Sherif Aliti  
#5 Posted : Monday, May 27, 2024 11:01:46 AM(UTC)
Sherif Aliti

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 2/16/2021(UTC)
Posts: 45
Albania
Location: Fier

Thanks: 28 times
Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: Rob Go to Quoted Post
I was thinking the EXE was versioned by folder names, but it sounds like the EXE itself is what name changes?

Can you give me the full path and file name of the EXE before and after it is updated? That way I can fully visualize what changes and how it's being used.





Yes, I can, but the problem is that in my job we get very often updates, and EXE name is changed on each update.
So after each update, I must change EXE File name.

Example

This is the path and actually file name
Quote:
D:\Mobile\UnlockTool\UnlockTool-2024-05-18-0.exe
- but file name of exe will change after each update!


example of changing name
example of name change after Update










Rob  
#6 Posted : Tuesday, May 28, 2024 1:17:50 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,382
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 431 time(s) in 364 post(s)
Okay, change from Steps to Script and paste the script below.

It assumes the naming of the UnlockTool EXE name will be sortable alphabetically with newer versions, which appears to be the case based on what you've shown me.
Code:
let unlockToolBasePath = "D:\\Mobile\\UnlockTool"
var latestUnlockToolEXE = new System.IO.DirectoryInfo(unlockToolBasePath).EnumerateFiles("UnlockTool-*.exe").OrderBy("Name desc").First();
sp.Run(`${unlockToolBasePath}\\${latestUnlockToolEXE.Name}`);
thanks 1 user thanked Rob for this useful post.
Sherif Aliti on 6/13/2024(UTC)
Sherif Aliti  
#7 Posted : Thursday, June 13, 2024 8:55:11 PM(UTC)
Sherif Aliti

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 2/16/2021(UTC)
Posts: 45
Albania
Location: Fier

Thanks: 28 times
Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: Rob Go to Quoted Post
Okay, change from Steps to Script and paste the script below.

It assumes the naming of the UnlockTool EXE name will be sortable alphabetically with newer versions, which appears to be the case based on what you've shown me.
Code:
let unlockToolBasePath = "D:\\Mobile\\UnlockTool"
var latestUnlockToolEXE = new System.IO.DirectoryInfo(unlockToolBasePath).EnumerateFiles("UnlockTool-*.exe").OrderBy("Name desc").First();
sp.Run(`${unlockToolBasePath}\\${latestUnlockToolEXE.Name}`);



As begin , it work Gr8, after I download another version I will add again in this thread. I can rename manually but I will try after download


Sherif Aliti  
#8 Posted : Sunday, June 30, 2024 9:07:47 PM(UTC)
Sherif Aliti

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 2/16/2021(UTC)
Posts: 45
Albania
Location: Fier

Thanks: 28 times
Was thanked: 1 time(s) in 1 post(s)
That command work gr8, thanks a lot
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.