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 7th, 2008, 11:23 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] Presenting a Menu (as with 'Choice')

Objective:
I have a PortableApps-enabled USB drive, and I'm using the Portable Sunbird that's on it to keep track of my time at any available computer. I also use a stationary installation of Sunbird on my desktop and (soon) another on my laptop. (Portable Sunbird is still in version 0.3, while the standard one from Mozilla is at 0.7. Also, I might not always have my USB stick available, so this is safer than only using Portable Sunbird.) I want to write a macro that will ask me, when I plug my USB drive into a computer, which calendar should be migrated to the other Sunbird: the portable one, the stationary one, or neither.

Problem:
Each download of PortableApps is packaged with an "Autorun.inf" file to allow the user to quickly start the menu each time the subject drive is plugged in, and I have modified that file so it starts my "disbatch.bat," which in turn starts the PortableApps menu and should ask me which action to take. But because I'm using Windows XP and the only multiple-choice command I know of is choice, I get this:
Quote:
'choice' is not recognized as an internal or external command, operable program or batch file.
What can I use instead?

BTW, I know I'll probably find more problems when I try to do more than just start Sunbird (export, import, and close) from a batch, but for now I need my menu to work.

Here's "disbatch.bat":
Code:
@ECHO OFF
:: disbatch.bat

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

:: 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. Migrate data from portable calendar to stationary installation.
ECHO b. Migrate data from stationary calendar to portable installation.
ECHO c. Migrate no data.
choice /c:cba /tc,10 Which option do you choose [a,b,c]?
:: Delete this line when the menu is fixed:
PAUSE>NUL

:: Do as directed.
IF ERRORLEVEL 3 GOTO a
IF ERRORLEVEL 2 GOTO b
IF ERRORLEVEL 1 GOTO c

:a
::
GOTO done

:b
::
GOTO done

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

:done


Thanks!

Last edited by Jesdisciple : January 7th, 2008 at 02:23 PM. Reason: to include category in title

Reply With Quote
  Trader Rating: 0 · #2  
Old January 7th, 2008, 12:49 PM
DrStrangluv's Avatar
DrStrangluv DrStrangluv is offline
Contributing User
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: May 2007
Posts: 197 DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 5 Days 17 h 33 m 59 sec
Reputation Power: 320
I suggest using Google calendar, or a similar online app.

Reply With Quote
  Trader Rating: 0 · #3  
Old January 7th, 2008, 12:53 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
My laptop has no Internet access and my desktop only has dial-up, so I need an offline solution for such an essential purpose.

Reply With Quote
  Trader Rating: 0 · #4  
Old January 7th, 2008, 01:11 PM
DrStrangluv's Avatar
DrStrangluv DrStrangluv is offline
Contributing User
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: May 2007
Posts: 197 DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level)DrStrangluv User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 5 Days 17 h 33 m 59 sec
Reputation Power: 320
then use google gears with it.

Reply With Quote
  Trader Rating: 0 · #5  
Old January 7th, 2008, 01:55 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
This is how I do it...
Code:
:question
ECHO Which opton do you choose [a,b,c]?
:: Wait for user input
 set /p ANSWER=
if %ANSWER%==a GOTO a
if %ANSWER%==b GOTO b
if %ANSWER%==c GOTO c
::The program will only run the followng statement if the user made a choice that was not available.
GOTO question

I never got choice.com working (same message). Not sure if I have it installed.

Reply With Quote
  Trader Rating: 0 · #6  
Old January 7th, 2008, 10:06 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
Thanks Safety! That does the trick.

I don't suppose anyone knows what language I might use to write a macro for Sunbird? (Maybe an extension could make this possible with JavaScript...)

DrStrangluv, you might be wondering right now why I don't use Gears. I still couldn't download the calendar to, or upload the calendar from, my laptop, so I'd be in the same pickle as I am right now. There's no way around it: I must transfer the calendar by my USB stick; this is an attempt to streamline the two-way process.

Reply With Quote
  Trader Rating: 0 · #7  
Old January 9th, 2008, 09:52 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
Never used sunbird... so I can't help there.

Glad it worked for you though... never know if someone wants the simple answer or not.

Reply With Quote
Reply

Viewing: Dev Hardware ForumsSOFTWAREProgramming > Presenting a Menu (as with 'Choice')


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 2 hosted by Hostway
Stay green...Green IT