Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Testing for read only

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,46898
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Testing for read only
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Testing for read only - 5/9/2007 7:30:49 AM   
  pont

 

Posts: 2
Score: 0
Joined: 5/9/2007
Status: offline
Is there a way to test if a drive is read only/write protected? I'm trying to write a script to empty a digital camera. The camera is a Sony and for some reason the internal memory is read only - you can't move or delete images from Explorer or with a script. Trying to do it with the script results in a error message saying that the drive is read only, please change its settings and Retry/Resume/Abort. This error message is popped up by the system and not by wsh. Clicking Resume does just that and the error checking in the script kicks in. I've tried to find a way to test the drive without getting the system error message but no luck. For example, there doesnt seem to exist an attribute for a drives read/write permission.

Can someone shed a light on this? Thanks!
 
 
Post #: 1
 
 RE: Testing for read only - 5/9/2007 7:37:51 AM   
  mikeock


Posts: 124
Score: 1
Joined: 6/8/2006
Status: offline
Are you moving the files?

I would recomend just copying them and then deleting them on the camera once you are done.

_____________________________

My sig sucks!

(in reply to pont)
 
 
Post #: 2
 
 RE: Testing for read only - 5/9/2007 7:53:46 AM   
  ebgreen


Posts: 5250
Score: 31
Joined: 7/12/2005
Status: offline
I don't know the answer to your quaestion. For reference however I will post my script that moves pics from a camera to a dir on the hard drive. It is probably one of the very first VBScripts that I ever wrote and so is full of things that I would do differently now. I have since written the same app in Python and C#. It seems to be one of the first things that I do when learning a new language. Don't ask me why. It uses a configuration XML file which I will also post.


      


      

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to pont)
 
 
Post #: 3
 
 RE: Testing for read only - 5/9/2007 8:12:24 AM   
  pont

 

Posts: 2
Score: 0
Joined: 5/9/2007
Status: offline
@mikeock
Yes, I'm moving the files. I work at a preschool where the computer literacy is somewhat varied. We use digital photos a lot and I want to make it as easy as possible to move the files to the computer. I could use the Camera/Scanner guide, but that is cheating...  :o)   It's a little bloated and my script is easier to use with fewer options and less clicking. Another aspect is that we are using a few different cameras and the script should work for all of them. The script is also in use on other preschools with different cameras.
So - I have a working script but I'm not completely satisfied with it. I want to test the drive to make it less specific for a certain type of camera.


@ebgreen
Thanks, but as I say above - the general script is already done. I just want to test the drive instead of looking for a specific folder that might not be the same across different cameras.

(in reply to ebgreen)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Testing for read only Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts