Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I want to send the line
CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, Falseto a vbs file so i tried the following line of code
echo CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False>invis.vbshowever that doesn't work, seems to not like all the symbols that are in it. Returns the following error.
C:\Documents and Settings\Nathan\Desktop>echo CreateObject("Wscript.Shell").Run
"""" & WScript.Arguments(0) & """", 0, False 1>invis.vbs
CreateObject("Wscript.Shell").Run """"
'WScript.Arguments' is not recognized as an internal or external command,
operable program or batch file.
'""""' is not recognized as an internal or external command,
operable program or batch file.

Tried that and now i get the following error
C:\Documents and Settings\Nathan\Desktop>echo CreateObject("Wscript.Shell").Run
"""" & WScript.Arguments(0) & """", 0, False 1>invis.vbs
CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0)
'""""' is not recognized as an internal or external command,
operable program or batch file.

According to my copy/pasting of what you entered, you've broken up the line into two parts. That won't work with only one ECHO, nor would the resulting lines work in VBScript.

If it's one line you need to 'escape' the chars which have 'special meaning'. In this case, the &. So use this:
echo CreateObject("Wscript.Shell").Run """
" ^& WScript.Arguments(0) ^& """", 0, False>invis.vbs===========================
that's ONE liine
=====================================
If at first you don't succeed, you're about average.M2

![]() |
Dictionary development
|
Q for Justin Weber
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |