1 Replies - 3621 Views - Last Post: 09 September 2009 - 10:59 PM Rate Topic: -----

#1 pitccorp01  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 09-September 09

syntax for shell command with parameters

Posted 09 September 2009 - 05:25 PM

Hi,

I am trying to setup a variable in VB, which will execute a shell command (autostatus.exe) with a parameter (-j JobName), and later display the output of the said variable. The code thus far is...

Dim JobName 
Dim JobStatus
JobName = "asysr11_set_global_var_2day"
JobStatus = ShellExecute("autostatus.exe", -j, JobName)


What is the easiest way to achieve this? Currently, the above code returns error message "line:4, Type mismatch: 'ShellExecute', code: 800A000D"

Thanks,
Anthony

Is This A Good Question/Topic? 0
  • +

Replies To: syntax for shell command with parameters

#2 Jay93  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 93
  • Joined: 04-August 09

Re: syntax for shell command with parameters

Posted 09 September 2009 - 10:59 PM

Its not shellexecute, its just shell(PathName as string and any required arguments)

eg:
Shell("notepad.exe" -s) 'Not sure what the s does but for an example itll do :)



If you look on the intellisense in Visual studio or Vb express, im guessing your using one of the two, it will show you the other optional paramaters.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1