?
Solved

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

Posted on 2014-09-25
2
Medium Priority
?
132 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 65

Accepted Solution

by:
RobSampson earned 2000 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Script to copy or move mouse-selected collection of files plus targets referenced by shortcuts (.lnk) The purpose of this article is to help illuminate the real challenges and options available (where they may exist) for utilizing simple scriptin…
This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

765 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