Run Vbs File From Cmd Peru
I am trying to run a command line utility from a VBS script but cannot get it to work. I can create a batch file with the command in and run it but i dont want to call external batch files within the script.
Source code for allhelp.vbs. Const INTERNAL_CMD_EXE = 'ASSOC COLOR ENDLOCAL FTYPE MKLINK POPD PUSHD. 'Open the HTML file; wshShell. Run ' ' & strFile. You get this error running a Visual Basic script for Active Roles Direct installed on a 64 bits server. I have a working VBS script to remove profiles but I want to make it auto run from a cd but the script needs syntax to run such as from a command line prompt. This is my example of the batch file i want to run with the vbs file from a cd.
The command is:csccmd /extract /target:c:Cache /recurse /onlymodified >C:CacheCacheresults.txt
I have tried the following:
Set WshShell = CreateObject('WScript.Shell')
WshShell.Run 'csccmd /extract /target:c:Cache /recurse /onlymodified >C:CacheCacheresults.txt'
Also have tried:
Option Explicit
Dim objShell
Set objShell = CreateObject(001dWScript.Shell001d)
objShell.Run 001ccsccmd /extract /target:c:Cache /recurse /onlymodified >C:CacheCacheresults.txtr001d
WScript.Quit
0018 End of VBScript command
The command box appears but then dissapears without running the command.
The first example works perfectly for the command 'ping machinename' but not for my command.
Any ideas?
I have the above code saved in a Vbs File and I am trying to execute this file through cmd prompt using the code below
Run Vbs File From Cmd Perus
The error message I receive is as follow
D:ProjectDriver ScriptDriverScript.vbs(1, 1) Microsoft VBScript compilation error: Invalid character
Run Vbs In Using Cscript
I am not quite sure whats wrong with above code with respect to very first line what the error seems to be pointing at. Any help is appreciated
Note: The Code credits goes to Anish from automationrepository website. I am just trying to build a QTP framework for my test cases using his tutorials and codes