vbscript
-
Hi Can some one help. I'm trying to run the following script but nothing happens
Option Explicit
Public objShell
dim in = "C:\test3.pdf"
dim out = "C:\test4.ps"
set input = in
set output = out
Set objShell = WScript.CreateObject ("WScript.shell")
objShell.run "c:\pdftops.exe -nocrop -noshrink -level3 %input% %output% " -
Hi Can some one help. I'm trying to run the following script but nothing happens
Option Explicit
Public objShell
dim in = "C:\test3.pdf"
dim out = "C:\test4.ps"
set input = in
set output = out
Set objShell = WScript.CreateObject ("WScript.shell")
objShell.run "c:\pdftops.exe -nocrop -noshrink -level3 %input% %output% "First, I assume you have run the pdftops.exe file with the defined inputs from a command prompt and it worked correctly. Having said that, are you sure the input and output parameters are even being passed to the command line? My suggestion, build the command line and replace the input/output parameters with the actual equivalents.
sCommand = "c:\pdftops.exe -nocrop -noshrink -level3 " & in & " " & out
objShell.run sCommand -
Hi Can some one help. I'm trying to run the following script but nothing happens
Option Explicit
Public objShell
dim in = "C:\test3.pdf"
dim out = "C:\test4.ps"
set input = in
set output = out
Set objShell = WScript.CreateObject ("WScript.shell")
objShell.run "c:\pdftops.exe -nocrop -noshrink -level3 %input% %output% "Of course it doesn't work. The command line you ran was exactly:
c:\\pdftops.exe -nocrap -noshrink -leve3 %input% %output%
VBScript does NOT do "automatic" variable replacement in strings. A string it treated as literal. The contents are not modified by what is in the string.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
Hi Can some one help. I'm trying to run the following script but nothing happens
Option Explicit
Public objShell
dim in = "C:\test3.pdf"
dim out = "C:\test4.ps"
set input = in
set output = out
Set objShell = WScript.CreateObject ("WScript.shell")
objShell.run "c:\pdftops.exe -nocrop -noshrink -level3 %input% %output% "Further to the other comments,
SET
in vbscript doesn't set an environment variable; it assigns the reference-type value on the right-hand side to the variable on the left-hand side. Since you've specifiedOption Explicit
and you haven't declared theinput
oroutput
variables, this should fail. http://msdn.microsoft.com/en-us/library/4afksd44%28v=vs.84%29.aspx[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Hi Can some one help. I'm trying to run the following script but nothing happens
Option Explicit
Public objShell
dim in = "C:\test3.pdf"
dim out = "C:\test4.ps"
set input = in
set output = out
Set objShell = WScript.CreateObject ("WScript.shell")
objShell.run "c:\pdftops.exe -nocrop -noshrink -level3 %input% %output% "1.
in
is a keyword. Do not use it. 2. Write the strings something like this...objShell.run "c:\pdftops.exe -nocrop -noshrink -level3" & input & " " & output
Beauty cannot be defined by abscissas and ordinates; neither are circles and ellipses created by their geometrical formulas.