Solved

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

Posted on 2014-09-25
2
125 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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

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…
Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

810 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