Solved

click on a file to run a cmd.exe

Posted on 2013-01-14
8
328 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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
 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
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…

838 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