+ Reply to Thread
Results 1 to 2 of 2

Run external program.

  1. #1
    Tom
    Guest

    Run external program.

    Hello,

    I have this macro (I'am trying remove all " from some txt file):

    Set objshell = CreateObject("WScript.Shell")
    objshell.Run "%comspec% /c gsar.exe -s"""""" -r -o ""C:\Program
    Files\Test\test.txt""", 1, True

    gsar.exe is in c:\windows and it works, but when I edit this macro like
    that:

    Set objshell = CreateObject("WScript.Shell")
    GsarPath = "gsar.exe is ingsar.exe"
    objshell.Run "%comspec% /c """ & GsarPath & """ -s"""""" -r -o
    ""C:\Program Files\Test\test.txt""", 0, True

    gsar.exe is in gsar.exe is in, it dosnt work.

    Can you help me?
    Thanks
    Tom



  2. #2
    Tom Ogilvy
    Guest

    Re: Run external program.

    Seems like you should get something running that has spaces in the name like
    GsarPath does. Then you can substitute in a variable in the string. What
    you have now produces pretty much what works except it puts double quotes
    around the gsar.exe is ingsar.exe where in your original, gsar.exe has no
    quotes around it. Maybe you need single quotes rather than double quotes.
    I can't say.

    --
    Regards,
    Tom Ogilvy


    "Tom" <fake@fakeland.com> wrote in message
    news:uv9VsxNQFHA.3140@tk2msftngp13.phx.gbl...
    > Hello,
    >
    > I have this macro (I'am trying remove all " from some txt file):
    >
    > Set objshell = CreateObject("WScript.Shell")
    > objshell.Run "%comspec% /c gsar.exe -s"""""" -r -o ""C:\Program
    > Files\Test\test.txt""", 1, True
    >
    > gsar.exe is in c:\windows and it works, but when I edit this macro like
    > that:
    >
    > Set objshell = CreateObject("WScript.Shell")
    > GsarPath = "gsar.exe is ingsar.exe"
    > objshell.Run "%comspec% /c """ & GsarPath & """ -s"""""" -r -o
    > ""C:\Program Files\Test\test.txt""", 0, True
    >
    > gsar.exe is in gsar.exe is in, it dosnt work.
    >
    > Can you help me?
    > Thanks
    > Tom
    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1