Rank: Advanced Member
Groups: Approved
Joined: 2/16/2021(UTC) Posts: 45 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
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,382 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);
|
1 user thanked Rob for this useful post.
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 2/16/2021(UTC) Posts: 45 Location: Fier Thanks: 28 times Was thanked: 1 time(s) in 1 post(s)
|
Originally Posted by: Rob 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.
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,382 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.
|
1 user thanked Rob for this useful post.
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 2/16/2021(UTC) Posts: 45 Location: Fier Thanks: 28 times Was thanked: 1 time(s) in 1 post(s)
|
Originally Posted by: Rob 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. 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
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,382 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}`);
|
1 user thanked Rob for this useful post.
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 2/16/2021(UTC) Posts: 45 Location: Fier Thanks: 28 times Was thanked: 1 time(s) in 1 post(s)
|
Originally Posted by: Rob 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
|
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 2/16/2021(UTC) Posts: 45 Location: Fier Thanks: 28 times Was thanked: 1 time(s) in 1 post(s)
|
That command work gr8, thanks a lot
|
|
|
|
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.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close