Solved

Need VBScript to lauch an executabel with parameters and direct the output to a text file

Posted on 2014-09-25
2
123 Views
Last Modified: 2014-09-26
Here's my command line that works perfectly from a cmd prompt.
C:\BETASys\exf.exe  -c "C:\BETASys\BETASys.md5" > "%USERPROFILE%\AppData\Local\Test\Intergrity_check_results.txt"

However, I can't figure out how to lauch this same command from a VBScript.
May I ask for some help ?
0
Comment
2 Comments
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 40345204
Hi, this should work.  Since you're using the DOS only output redirector, you need to initiate cmd.exe.  Using the /c switch means the command windows closes once complete.

Set objShell = CreateObject("WScript.Shell")
strCommand = "cmd /c C:\BETASys\exf.exe  -c ""C:\BETASys\BETASys.md5"" > ""%USERPROFILE%\AppData\Local\Test\Intergrity_check_results.txt"""
objShell.Run strCommand, 1, True

Open in new window


Regards,

Rob.
0
 
LVL 1
ID: 40345930
Perfect !
I can't thank you enough.

:)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this article we want to have a look at the directory attributes which are used by Microsoft to store the so called Security Identifiers (SID). These SIDs plays an important role in delegating and granting permissions and in authentication of trus…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 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

19 Experts available now in Live!

Get 1:1 Help Now