Solved

click on a file to run a cmd.exe

Posted on 2013-01-14
8
321 Views
Last Modified: 2013-01-16
want to run this command in cmd.exe by clicking on a file
(ideally without using visual studios or visual basic, want to just use simple windows7)

C:\gyb>gyb --email gmail@gmail.com --backup
note, I need to be in c:\gyb folder

another question is run this file every 30 minutes


I think this information is unrelated to question:
this is to back up gmail to windows os
http://code.google.com/p/got-your-back/wiki/GettingStarted
0
Comment
Question by:rgb192
  • 4
  • 2
  • 2
8 Comments
 
LVL 9

Expert Comment

by:the_b1ackfox
ID: 38776797
So turn it into a cmd file:

start->run type in cmd <hit enter>
type in cd\ <hit enter>
then cd\ c:\ (you can add another directory if you would like this elsewhere)
your prompt should look something like this c:\>

Now type in copy con gyb.cmd <hit enter>
cd\ <hit enter>
cd c:\gyb <hit enter>
gyb --email gmail@gmail.com --backup  <hit enter>
exit <hit enter>

now hit control z

you should be back at your command prompt

You should have a file in that directory call gyb.cmd
double clicking on it should run your program (excusing any of my typos)
0
 

Author Comment

by:rgb192
ID: 38776887
when I type
exit <enter>

cmd disappears

and does not return when I type ctrl z
0
 
LVL 9

Accepted Solution

by:
the_b1ackfox earned 300 total points
ID: 38777100
ok, copy all of this into a text file:

cd\
cd c:\gyb
gyb --email gmail@gmail.com --backup  
exit


save it as gyb.cmd   (make sure it doesn't save as gyb.cmd.txt)

And you should be good
0
 
LVL 8

Expert Comment

by:deepu chandran
ID: 38777687
Hi,

One more option you have is to Create a VBScript (.vbs) file and Schedule the VBS on Windows Task Schdule to run for every 30 Min

Refer below URLs

http://stackoverflow.com/questions/5467818/execute-dos-command-from-vbscript
http://msdn.microsoft.com/en-us/library/d5fk67ky(v=vs.85).aspx

-- Deepu
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:rgb192
ID: 38778583
I dont understand where to write file
0
 
LVL 8

Assisted Solution

by:deepu chandran
deepu chandran earned 200 total points
ID: 38781413
Hi,

Write it on a notepad or wordpad(any Editor is Fine, Sytax highlight is avaialble on Notepad+ and ultaedit). Save the file as .vbs(vb script file) or cmd

--Deepu
0
 

Author Comment

by:rgb192
ID: 38785477
what is the command I should write and save as a .vbs file
0
 

Author Closing Comment

by:rgb192
ID: 38785806
thanks

now I can run the command by clicking on a file
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now