Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   Dev Hardware ForumsSOFTWAREProgramming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Hardware Forums Sponsor:
  Trader Rating: 0 · #1  
Old January 12th, 2008, 11:14 AM
Jesdisciple Jesdisciple is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Location: Tejas
Posts: 9 Jesdisciple User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 3 m 29 sec
Reputation Power: 0
Send a message via AIM to Jesdisciple Send a message via MSN to Jesdisciple Send a message via Google Talk to Jesdisciple
NT Batch - [NT Batch] Copying

I almost have the file from my previous post finished. I found out from the Mozillazine community that Sunbird stores calendar data in an SDB database file. My batch now attempts to copy one database file to the location of the other, but the copied file appears in my USB root directory, where it can't do any good. Why? Thanks!

Code:
@ECHO OFF
:: disbatch.bat

:: Start PortableApps.
START PortableApps\PortableAppsMenu\PortableAppsMenu.exe  

:: NOTE: There isn't really a space character between "\DefaultData" and "\profile":
SET cargo=PortableApps\SunbirdPortable\App\DefaultData  \profile\storage.sdb
SET station=
SET laptop=C:\Documents and Settings\_Somebody_\Application Data\Mozilla\Sunbird\Profiles\x86bg1hg.default\sto  rage.sdb
SET home=C:\Documents and Settings\_SomebodyElse_\Application Data\Mozilla\Sunbird\Profiles\itlexnrd.default\sto  rage.sdb
:: Prompt the user (me) for whether to migrate my calendar (for Sunbird)
::	 from my USB stick to my PC (laptop or desktop), vice versa, or not at all.
ECHO What do you want to do?  Your options follow.
ECHO a. Copy data from portable calendar to stationary installation.
ECHO b. Copy data from stationary calendar to portable installation.
ECHO c. Copy no data.
:question
ECHO Which opton do you choose [a,b,c]?
:: Wait for user input.
SET /P answer=

:: Do as directed.
IF %answer%==a GOTO a
IF %answer%==b GOTO b
IF %answer%==c GOTO c
:: The program will only run the following statement if the user made
::	a choice that was not available.
GOTO question

:a
IF EXIST laptop SET station=%laptop%
IF EXIST home SET station=%home%
IF station== ECHO Error: Neither stationary file was found.
COPY %cargo% "%station%"
ECHO Mission accomplished: This stationary calendar now reflects your portable one.
GOTO done

:b
IF EXIST laptop SET station=%laptop%
IF EXIST home SET station=%home%
IF station== ECHO Error: Neither stationary file was found.
COPY %station% "%cargo%"
ECHO Mission accomplished: Your portable calendar now reflects this stationary one.
GOTO done

:c
ECHO Very well.  Handle it yourself, then.

:done
PAUSE

Reply With Quote
  Trader Rating: 0 · #2  
Old January 18th, 2008, 07:51 PM
omrsafetyo's Avatar
omrsafetyo omrsafetyo is offline
Contributing User
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Location: Maine, USA
Posts: 297 omrsafetyo User rank is Captain (20000 - 30000 Reputation Level)omrsafetyo User rank is Captain (20000 - 30000 Reputation Level)omrsafetyo User rank is Captain (20000 - 30000 Reputation Level)omrsafetyo User rank is Captain (20000 - 30000 Reputation Level)omrsafetyo User rank is Captain (20000 - 30000 Reputation Level)omrsafetyo User rank is Captain (20000 - 30000 Reputation Level)omrsafetyo User rank is Captain (20000 - 30000 Reputation Level)omrsafetyo User rank is Captain (20000 - 30000 Reputation Level)omrsafetyo User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Days 21 h 32 m 32 sec
Reputation Power: 221
Send a message via AIM to omrsafetyo
Can you give an example of the problem??

I'm not sure I understand. Do both options a and b result in copying the database file to the portable drive root?

Reply With Quote
  Trader Rating: 0 · #3  
Old February 27th, 2008, 12:56 PM
Jesdisciple Jesdisciple is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Location: Tejas
Posts: 9 Jesdisciple User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 3 m 29 sec
Reputation Power: 0
Send a message via AIM to Jesdisciple Send a message via MSN to Jesdisciple Send a message via Google Talk to Jesdisciple
Sorry I'm so late in replying! I think it's only option 'b' that misses the mark (for the portable root), although 'a' might land somewhere that I'm not looking.

Reply With Quote
Reply

Viewing: Dev Hardware ForumsSOFTWAREProgramming > NT Batch - [NT Batch] Copying


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT