Home / Microsoft / Microsoft DOS / Batch to run a exe program & script.
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] - (Bottom) Print
Author Topic: Batch to run a exe program & script.  (Read 525 times)
duelz
Topic Starter
Starter



Posts: 3


« on: November 10, 2009, 03:06:47 AM »

I need to batch file that able to execute the command from a text file that residing in different folder.
I need this file to run in startup, this is to ensure everytime the system reboot will resume back the script.
Currently, I'm manually run the script, but to ensure there is no interuption after a reboot, I need a script able to do the job automatically after a system boot up.

In the text file, it content of a executable program.

Note: sharecheck is a exe file.
text file name: sharecheck_script.txt
Text file content:
sharecheck -sharefile sharecheck.txt -look -monitor -to list.Server@company.com -smtp 123.222.32.10 -from list.Server@company.com


Thanks for the help!
duelz


IP logged
Two-eyes
Intermediate



Thanked: 4
Posts: 166




« Reply #1 on: November 10, 2009, 09:47:54 AM »

Hi there and welcome to the Computer Hope Forums.
Hope you become a regular here to get some answers (and, why not?, share your own information with others).

Coming to your problem...

Save the text file as a batch file.  That is, change the extension to .bat instead of .txt.  You need to have the extensions visible to do that (one way of showing extensions: open a folder > tools > folder options > click on the "view" tab > UNcheck "hide extensions for known file types".)

Then open the startup folder (start > all programs > double click on "start up" folder).  Copy and paste the .bat file, or make a shortcut and put it in the stratup folder.  That should execute your .exe file when the system boots up (and user setting starts to load).

Quote
this is to ensure everytime the system reboot will resume back the script
Did you mean current progress is saved and at reboot it continues from where it left off?  In that case, I'm not sure how to do that.

Hope this helped

Two-Eyes %
IP logged

Quote
I believe the bushes in my yard will BURN before God picks up a PC to send a message

billrich
Guest
« Reply #2 on: November 10, 2009, 11:00:12 AM »

Is the following the program you are using? :

http://webscripts.softpedia.com/script/Miscellaneous/ShareCheck-22129.html

ShareCheck Javascript lets you view shares at one of several stock exchanges.

This Javascript lets you view shares at one of several stock exchanges. This is achieved by linking to MSN's moneycentral web site.

You click on the "Add" link to enter your company's name, and this will create a link on your web page to that company's share information until you remove that link.

If you are not sure of how to enter your company' s name, use the "Find" link.
IP logged
duelz
Topic Starter
Starter



Posts: 3


« Reply #3 on: November 10, 2009, 11:24:16 PM »

Hi, thanks for the reply.
I've tried this method, but it can't execute the particular command "-sharefile". I attached the screenshot that I got it after I run the batch file.
Basically, I need the batch to execute this whole line of command and it would able to send email to my mailbox.

ECHO OFF
Start "C:\abu checks\sharecheck.exe" -sharefile "C:\abu checks\sharecheck.txt" -k -look -monitor -to list.server@company.com -smtp 123.222.32.10 -from list.server@company.com

Additional info, the batch file work fine in C:\abu checks\sharecheck.bat but when i move over the sharecheck.bat to the startup folder, it gave me the following error (pls refer the screenshot).

Any help/ suggestion would be much appreciated.

Thanks.
Duelz


[Saving space, attachment deleted by admin]
« Last Edit: November 10, 2009, 11:36:36 PM by duelz » IP logged
duelz
Topic Starter
Starter



Posts: 3


« Reply #4 on: November 10, 2009, 11:28:43 PM »

Is the following the program you are using? :

http://webscripts.softpedia.com/script/Miscellaneous/ShareCheck-22129.html

ShareCheck Javascript lets you view shares at one of several stock exchanges.


No, sharecheck is a monitoring tool. this is the output of success execution.

Share Monitor mode enabled
  Reports will be sent to list.server@company.com
  Report sender is list.server@company.com
  SMTP host for email is 123.222.32.10
  Monitor interval is 120 seconds
Starting share check at Wed Nov 11 14:26:26 2009
  Shares Checked      : 44
  Successful Checks   : 44
  Connect Failures    : 0
  Find File Failures  : 0
  Time elapsed        : 7 seconds
Share check pass complete at Wed Nov 11 14:26:33 2009
IP logged
Two-eyes
Intermediate



Thanked: 4
Posts: 166




« Reply #5 on: November 12, 2009, 10:54:12 AM »

Hi there,

I don't know why that error came up.
sharefile is a switch, right?  I don't know why it couldn't "find" it, it's not a file.

I'm sorry, but I can't help you further :(

Two-Eyes %
IP logged

Quote
I believe the bushes in my yard will BURN before God picks up a PC to send a message

Pages: [1] - (Top) Print 
Home / Microsoft / Microsoft DOS / Batch to run a exe program & script. « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.103 seconds with 20 queries.