Jump to content
Macro Express Forums

Running A Command Prompt Thur Macro


ispaydeu
 Share

Recommended Posts

Hello all,

I am a first time poster but long time user of Macro Express and long time reader of the boards. I have tried searching for this in the past but never seem to get a good answer or can never come up with a good keyword to narrow my results.

 

Anyways, I have a process that I run in which I activate cmd.exe (Command Prompt, the same on that comes up when you type in CMD in the Start>Run area), then have my macro type in commands into it.

 

Long story short, I have a zip program that allows me to zip files thru using command line prompts. I have a macro that runs that downloads a few rather large files every night off of our server. The files are too big so I was trying to come up with a solution for easily zipping them but WITHOUT using a regular zip program's interface (I try to avoid making my macro move the mouse or do anything like that at all). So, what I ended up deciding todo was to get my hands on a zip program that would allow me to zip using the command prompt, at least that way all I had to do was have the macro type in commands.

 

The problem I am running into is, since my macro runs at night when I am not here, it will never work because the machine is locked. Well it works, just not for this part. According to research on the forum, that is because a scheduled macro that runs on a locked Pc will not be able to use operations that require processing of windows (per se). So, basically, the problem I am running into is that my program will open the command prompt, and have difficult passing commands to it.

 

So, I guess I really have 2 questions, first, is there any zip program out there that you guys use in which the integration with it and with macro express is a hand in hand good situation? Ie, such a problem would not occur?

 

Second question, is there a way to have macro express pass commands directly to the command prompt? Similar to how you can have macro express log into a FTP site and have full functionality within the FTP (change directories, delete, download) without have to see the process and type into it.

 

So, I need a solution, either a zip program, or a direct interaction with command prompt.

 

Any ideas?

 

Matt

Link to comment
Share on other sites

Macro Express was not designed to send text to an MS DOS window. However, since the command prompt in Windows XP is a windows program, Macro Express can send keystrokes to it using the Text Type command.

 

Another alternative is to create a macro that creates a batch file containing all the commands needed to compress the file and use the Activate/Launch command to launch the .bat file.

Link to comment
Share on other sites

I currently DO use the text type option to do my actions thru command prompt. I just launch command prompt, wait for the window to appear, then have it start typing. I understand all of that, it would just be nice to be able to send commands straight into it that way you could still do some command prompt features when a PC is locked up.

 

Please explain what you are talking about for the batch file, I am interested but am not sure what you are referring to. Please, do explain :).

Matt

Link to comment
Share on other sites

Given ME's inability to run scheduled tasks when a machine is locked, I get around this (in Windows XP) by creating various scheduled tasks (using Windows' own scheduler) to run ME macros, as in folder\Meproc.exe /AMacroname (and you can extend this syntax to initialize variables as well, so long as the macro starts with a Variables Restore command).

 

I take this concept further by having a pair of macros that work in concert with each other. The first allows my machine to autologin, and reboots the machine immediately. The second removes the autologin and hibernates the machine. In between I run whatever processing I require.

 

One important note: when you create a scheduled task that is to run when your machine is hibernating, you must go into its settings tab and check "Wake the computer to run this task".

Link to comment
Share on other sites

Paul, so if you save your macro express file somewhere, lets say as "C:\my macro\scheduleme.mex". Then, setup windows scheduler to, isntead of launching "Macro Express 3", and actually browsing for a location, then by doing that it will make it so the windows can be interacted with? I am a little confused. I really need to be able to interact with the windows and I am not sure if I will be able to change my machine so that certain do NOT occur (such as loggin in on the next reboot without using a password) because of the way my network at work is setup.

Matt

Link to comment
Share on other sites

You create a batch file and use the Activate or Launch command. Here is a knowledgebase article about calling a batch file from a Macro Express macro.

 

Batch file programming is a topic all on its own and is beyond the scope of this forum. There are literally millons (3,970,000 :) ) of references on the web. Here are links to the first four that came up in a Google search (for 'Windows batch'):

 

http://www.microsoft.com/resources/documen...h.mspx?mfr=true

http://www.iopus.com/guides/batch.htm

http://labmice.techtarget.com/articles/batchcmds.htm

http://www.computerhope.com/batch.htm

Link to comment
Share on other sites

Paul, so if you save your macro express file somewhere, lets say as "C:\my macro\scheduleme.mex". Then, setup windows scheduler to, isntead of launching "Macro Express 3", and actually browsing for a location, then by doing that it will make it so the windows can be interacted with? I am a little confused. I really need to be able to interact with the windows and I am not sure if I will be able to change my machine so that certain do NOT occur (such as loggin in on the next reboot without using a password) because of the way my network at work is setup.

Matt

I'm sorry, I don't understand what you're asking here?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...