Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently January 9th, 2025, 9:52 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: How to scan or test for a particular folder on a drive
PostPosted: April 2nd, 2008, 10:42 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
I want to set up the initial page of a Pub as a landing page for user logon. There I would have the User select which data files he is working with... e.g. on C: drive or on a USB drive.

I would have the user install the Pub on a work PC and a home PC, and have certain Read/Write files on a Flash drive. That way he has some portability. (I'm guessing 'synching' would be too challenging? So just work off of the one set).

How would I set this up?
I am thinking to check drives and paths to "find" where that "working folder" is. But Drive Letters change. And Opus has a test for file exists, but not for folder exists?

Also, is there a way to get at "Last Modified" properties of folder... just in case two or more folders of same name exist?

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject:
PostPosted: April 10th, 2008, 8:15 am 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
If you know the folder and file name, but not the drive, you could try a brute force check and run through the alphabet to see which returns a positive?? not very elegant, but it might do the job?Or what about getting the user to browse for the file? then putting the path into a variable.

Sandy

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
 Post subject:
PostPosted: April 10th, 2008, 7:13 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Thanks Sandy.

I'd want to make it ~foolproof and certainly transparent or simple for the user. I think letting the User identify it would be okay, if I could present a shortlist of valid drives.

I have not tried bruteforce cycle thru the alphabet. That may not be so bad (as long as the user does not make a copy to another drive... becomes a decoy).

Deeper/techie:
I found this on MSDN site.
http://tinyurl.com/5pcjy2
One thread suggests get WMI Object Win32_LogicalDisk using PowerShell. (pic), but I have no idea how that could be used from Opus.

Cheers.


You do not have the required permissions to view the files attached to this post.

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject:
PostPosted: April 11th, 2008, 8:34 am 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
Running through the letters of the alphabet would be relatively easy to do in script. It could be done in a loop to run through the possible drive letters.
You could then detect multiple copies on different drives.


Another couple of options is to search for a DLL to give the information, or it will be saved in the registry somewhere? however, that will probably only give you the valid drive letters, you would then still have to check them to see if a valid file exists, so doing the check on all drive letters may be just as easy???

Sandy

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
 Post subject:
PostPosted: April 14th, 2008, 3:23 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Sandy,

Thanks.

Quote:
Or what about getting the user to browse for the file? then putting the path into a variable.
I did not read that close enough. Or I just had my 'head' stuck on drives and paths.

To-date I have not used that file-browse feature of Opus at runtime. Once I read another separate question ( viewtopic.php?t=3157 ), it clicked for me.

I think that's an acceptable approach. Now I'll have to figure out the logic of when to ask the user and what choices to give him. Pretty simple after all.

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject:
PostPosted: April 30th, 2008, 3:05 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
I came across a few utilities and in a couple cases... solutions to other problems and hurdles.

The resources/links do NOT exactly solve what I was trying to accomplish (an Opus exe installed on 2 machines and 'portable files' for user data/writes). But are worthy of noting here in case others find a use for them or a way to solve Opus portability.

One thing I've noticed about Vista (vs. WinXP or prior) is that Vista does not automatically 'adapt' to new Paths when drive letters are changed (manually)?

Quotes below are not from Opus forum:
Quote:
USBDLM is a Windows service that gives control over Window's drive letter assignment for USB drives. Running as service makes it independent of the logged on user's privileges, so there is no need to give the users the privilege to change drive letters.
It automatically solves conflicts between USB drives and network or subst drives of the currently logged on user.
Furthermore you can define new default letters for USB drives and much more.
above from
http://www.uwe-sieber.de/usbdlm_e.html

Quote:
A "How-to Geek" aritcle/post: A user writes: "Well written, easy to understand, and now it makes sense why this would happen in an environment where drive letters change from time to time. THANKS for the help in solving the missing USB drive letter!"
above from
http://www.howtogeek.com/howto/windows/ ... indows-xp/


Quote:
PortableApps.com provides a truly open platform that works with any hardware you like (USB flash drive, iPod, portable hard drive, etc). It's open source built around an open format that any hardware vendor or software developer can use.
The Portable Apps Suiteā„¢ is free.
above from
http://portableapps.com/
( a concern here may be control/redistribution... seems like most Apps are not controlled licenses )

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 62 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group