I'm trying to look for a way to set reminders between my homepc and work pc. And I need it something like this:

I put a text file in dropbox on homepc, and let it get uploaded to dropbox (synced)

When I open my WorkPC, the file gets downloaded to my pc via dropbox.

The program on my workpc sees a modified file in the dropbox folder, and opens it.

This way whenever I set changes to that text file, the program (homepc or workpc) opens it on windows start. This should only occur once on startup, and should be set up on both the homepc and the work pc?

Can this be done by a batch script? Or some freeware/portable (preferably portable!)

Another Alternative could be, it just copies the modified text file from the dropbox folder to the desktop. My desktop on both PC's is clean (without any icons), so any file copied to desktop is clearly visible and then I can just see the reminders and delete the copied text file... This could be easy, but I don't know batch script programming..

1 Answer
1

It's already possible using Dropbox and torrents using utorrent. You have utorrent check a folder in your Dropbox for torrents, and if it finds one, it loads it and then deletes it (if you want).

I would dedicate a folder for this use. Use login scripts such that when you log in (there really isn't a way of going by startup), it will check the dropbox folder, and then bring it up in the editor of your choice. You may want the script to wait 30 seconds or so to make sure that Dropbox is running and has completely synced.

Again, we wait 60 seconds to get dropbox loaded and synced.
Then, for every reminder in the new reminder folder, we move it to the old reminders folder (oldrems), and if successful, we then run youreditor on the new file.

The %%~nxj takes the batch variable j and strips it down to just the filename and extension. Otherwise it would render to d:\dropbox\oldrems\d:\dropbox\reminders\whatthefilenameis.ext See FOR /? for more information.

The problem with this is that there could be file name collisions. In which case, move will NOT move the file, and it will be kept there until you remove it, or remove the file collision and log in again, in which case it will then get moved.

Does this help?

EDIT:
To open a file with it's default opener, replace youreditor with start ""

I always add "" as a title for start, because if you put your file in quotes (which I have done here, just in case the filename contains spaces) it will take the filename as the window name and then complain that there is nothing to open. Alternatively, if you are worried you may get a blank window title, you can just double the "d:\dropbox\oldrems\%%~nxj"

start "d:\dropbox\oldrems\%%~nxj" "d:\dropbox\oldrems\%%~nxj"

Which would then give you the name of the file for the window title.

Windows 95/98(/ME?) used start.exe (start in Win NT and above is embedded in CMD.EXE), and it never suffered this problem (and exists in my library as st.exe ;) )

Technically, just

"d:\dropbox\oldrems\%%~nxj"

should work. But not always. start "" "d:\dropbox\oldrems\%%~nxj" always does.

This will start all executable programs, so if you just want to have a .CMD file for further editing, you will have to change the extension, otherwise it will actually execute the .CMD file. Same with .BAT, .COM, .EXE, .PS1, .VBS and any other extensions. You have been warned.

One question: Instead of asking for the file to open in youreditor, which is notepad for text and photoshop for psd... can this script be changed to just open the files irrespective of program-preference? For eg., if I keep three files, txt, jpg, and psd, then an "open" command only could open these files in their default programs?
–
mk117Jun 15 '13 at 6:31

Hopefully my edit shows you the way to do what you want.
–
byteheadJun 15 '13 at 15:36