Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why won't it work?

Status
Not open for further replies.

patrick118

Technical User
Jan 14, 2004
315
NL
I want to install a program from a vbs script.

When i do it manually and put the following line in my run command it works great.

\\server01\programs\inoculate\image\setup.exe /N /S

So i created a script like this:

Set oWsh = CreateObject("WScript.Shell")
oWsh.Run("\\server01\programs\inoculate\image\setup.exe /N /S")

But it doesn't work now. Why? Can anyone give me an answer
 
Try:
oWsh.Run "\\server01\programs\inoculate\image\setup.exe /N /S"

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
And this ?
oWsh.Run "\\server01\programs\inoculate\image\setup.exe /N /S", 1, True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hello patrick118,

Read the console output to see what is the problem.
[tt]
logfile="d:\test\abc.txt" '<<<edit logfile location
oWsh.Run "\\server01\programs\inoculate\image\setup.exe /N /S 1>2>" & logfile
[/tt]
regards - tsuji
 
Tsuji,

It doesn't even create the logfile.

Hope you have an idea.

Patrick
 
patrick118,

Must have the poles of the globe switched over North South, South North. You see there are a couple of similar issue still open...

- tsuji
 
Not sure about the poles.....

Try Exec method maybe....

Code:
Set objShell = CreateObject("WScript.Shell")
set running = objShell.exec ("%comspec% /R \\server01\programs\inoculate\image\setup.exe /N /S>log.txt")
Do While running.Status = 0
  Sleep 100
Loop
 
I tried it but just won't work.

I don't understand why it won't. Anyway thanks for you help

PAtrick
 
patrick118,

As a further effort, host the script with cscript rather than wscript which I supposed it was hosting.
[tt]
cscript.exe //b //logo yourscript.vbs
[/tt]
- tsuji
 
Try the following solutions:

1. Use a runas command in your script, providing you are using XP or W2K Pro.

2. Within your script, copy the file to a local temp file, execute your setup command locally and delete the local temp file/folder.


Paul

Work on Windows, play on Linux.
 
\\server01\programs\inoculate\image\setup.exe /N /S
is wrong

or
\\server01\c$\programs\inoculate\image\setup.exe /N /S
or
\\server01\D$\programs\inoculate\image\setup.exe /N /S



Set oShell = WScript.CreateObject ("WSCript.shell")
oShell.run "cmd /c ""\\server01\c$\programs\inoculate\image\setup.exe /N /S"" "

here all work well
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top