Quantcast

Maximum PC

It is currently Fri Dec 19, 2014 6:41 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Synctoy and Flashdrive autorun
PostPosted: Sat May 07, 2011 12:36 pm 
Thoroughbred
Thoroughbred
User avatar

Joined: Sat May 07, 2011 12:30 pm
Posts: 1922
Location: A place not actively occupied by something else.
I would like to set up Synctoy and Windows 7's scheduler to run when a specific flash drive is inserted. I know a flash drive insertion will show up on one of the logs, but I can't figure out which one. I also know that an event in a log can be set as a trigger. Has anyone done this?


Top
  Profile  
 
 Post subject: Re: Synctoy and Flashdrive autorun
PostPosted: Sun May 08, 2011 7:18 pm 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Wed Jun 16, 2004 5:29 pm
Posts: 6328
Location: Far away from you
It works the same was as a CD or DVD...you would just utilize an autorun.inf that contains an open command to kick off sync toy.


Top
  Profile  
 
 Post subject: Re: Synctoy and Flashdrive autorun
PostPosted: Mon May 09, 2011 9:26 am 
SON OF A GUN
SON OF A GUN
User avatar

Joined: Mon Nov 01, 2004 5:41 am
Posts: 11605
+1 on AutoRun.

For that matter, I'd just use robocopy though.


Top
  Profile  
 
 Post subject: Re: Synctoy and Flashdrive autorun
PostPosted: Mon May 09, 2011 5:25 pm 
Thoroughbred
Thoroughbred
User avatar

Joined: Sat May 07, 2011 12:30 pm
Posts: 1922
Location: A place not actively occupied by something else.
How do I set up an Autorun to call up something outside of the flash drive's home directory?


Top
  Profile  
 
 Post subject: Re: Synctoy and Flashdrive autorun
PostPosted: Mon May 09, 2011 6:26 pm 
SON OF A GUN
SON OF A GUN
User avatar

Joined: Mon Nov 01, 2004 5:41 am
Posts: 11605
Why not just copy robocopy.exe to the flash drive, write a script using robocopy, and launch it with autorun?


Top
  Profile  
 
 Post subject: Re: Synctoy and Flashdrive autorun
PostPosted: Tue May 10, 2011 3:44 pm 
Thoroughbred
Thoroughbred
User avatar

Joined: Sat May 07, 2011 12:30 pm
Posts: 1922
Location: A place not actively occupied by something else.
I couldn't write a script more complex than an autorun.ini to save my life. :oops:


Top
  Profile  
 
 Post subject: Re: Synctoy and Flashdrive autorun
PostPosted: Tue May 10, 2011 4:52 pm 
SON OF A GUN
SON OF A GUN
User avatar

Joined: Mon Nov 01, 2004 5:41 am
Posts: 11605
It isn't too hard, we can help you!

A couple places to start: http://myitforum.com/cs2/blogs/dhite/ar ... cript.aspx

http://arstechnica.com/civis/viewtopic. ... 5&t=500244

Expand the above script to use your check your computer name first! http://www.robvanderwoude.com/vbstech_n ... mputer.php

Code:
Set wshShell = WScript.CreateObject( "WScript.Shell" )

objComputerName = "MyComputerName"
objSource = "PathToUSBFiles"
objDestination = "PathToBackUpFolderOnPC"

strComputerName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )

If strComputerName = objComputerName then
   objCommand = "RoboCopy.Exe " & Chr(34) & objSource & Chr(34) & " " & Chr(34) & objDestination & Chr(34) & " /e /r:1 /w:2"
   objShell.Run(objCommand)
End If


How about dynamically detecting the usb drive letter? http://www.codeguru.com/forum/showthread.php?t=408639


Top
  Profile  
 
 Post subject: Re: Synctoy and Flashdrive autorun
PostPosted: Wed Aug 03, 2011 8:42 pm 
Thoroughbred
Thoroughbred
User avatar

Joined: Sat May 07, 2011 12:30 pm
Posts: 1922
Location: A place not actively occupied by something else.
Thanks, guys. I can now program a little. Just in DOS or Processing (Arduino), though. With all those links, I should be able to do this. Also, sorry for taking so long to post back.


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

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 4 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

© 2014 Future US, Inc. All rights reserved.