Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. vbscript

vbscript

Scheduled Pinned Locked Moved Visual Basic
linuxtoolshelp
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    johnjsm
    wrote on last edited by
    #1

    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% "

    T D Richard DeemingR A 4 Replies Last reply
    0
    • J johnjsm

      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% "

      T Offline
      T Offline
      Tim Carmichael
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • J johnjsm

        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% "

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • J johnjsm

          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% "

          Richard DeemingR Offline
          Richard DeemingR Offline
          Richard Deeming
          wrote on last edited by
          #4

          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 specified Option Explicit and you haven't declared the input or output 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

          "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

          1 Reply Last reply
          0
          • J johnjsm

            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% "

            A Offline
            A Offline
            AlphaDeltaTheta
            wrote on last edited by
            #5

            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.

            ~ Carl von Clausewitz ~

            Source

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups