Blog

Home > Return Code > Wshshell Run Return Code 1

Wshshell Run Return Code 1

Contents

The code I am running is doing the correct thing as evidenced by the lack of a JScript runtime error. The application's console output? –Helen May 20 '11 at 5:49 add a comment| 1 Answer 1 active oldest votes up vote 11 down vote accepted You will want to use the List all multiplicative partitions of n How should I position two shelf supports for the best distribution of load? No idea..._________________Werner Daehn Product Manager Data Services SAP AG “The opinions expressed in this post are my own views and not those of SAP.” PLEASE SUPPORT THIS: Run one ATL job navigate here

intReturn = WShell.Run(strBATFile,0,True) If intReturn = 1 Then intReturn = 0 strJobStat = "Complete" Else If intReturn = 3 or intReturn=2 Then intReturn = 1 strJobStat = "Error" Else strJobStat = You'll find this interesting. I have also tried running IIS in IIS 5.0 isolation mode. Tuesday, September 04, 2012 10:10 PM Reply | Quote 0 Sign in to vote I ran wbadmin get status in an elevated command window and I get a -2 exit code http://www.visualbasicscript.com/WshShellRun-returns-error-code-1-Why-m91074.aspx

Wscript.shell Run Return Code

Once the cmd window is gone, it will continue. Set oShell=CreateObject("Wscript.Shell") iReturn=objShell.Run(shellCommand,1,True) WScript.Sleep 2000 Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colProcesses = I have a hunch not. Your original code had %comspec% /c in the run line, and did not have the iReturn= in the beginning. You need to "new ActuveXObject" the object.¯\_(ツ)_/¯ Monday, September 03, 2012 10:15 PM Reply | Quote 0 Sign in to vote Start here and get this to work before you try

Yes we did have the "-w" option turned on...these are the parameters we used... " [log directory] -w -t5000 -s [job server group] -S [repo server name] -NMicrosoft_SQL_Server -Q [repo db using $WshShell = new COM("WScript.Shell"); "Access is Denied" error when calling wshShell from ASP wshshell.run SOS! How do manufacturers detune engines? Vbscript Exec But why aren't we getting the Joblauncher return codes?

I have concluded that -1 means something issyntacticallywrong with the command, so I have to assume that WBAdmin is returning these values and this is probably not really a scripting question If the oShell.run actually waits, then I don't need to do the objWMIService.Execquery. Join Now For immediate help use Live now! https://social.technet.microsoft.com/Forums/scriptcenter/en-US/4a92021f-0378-46f9-932e-a25f4e18ad55/meaning-of-return-codes-from-wscriptshellrun?forum=ITCG The first thing I would find out is if these exit codes are documented somewhere.

How was I supposed to know that my mods to your code didnt work. Solve equation in determinant List all multiplicative partitions of n How can I forget children toys riffs? How can I forget children toys riffs? Connect with top rated Experts 15 Experts available now in Live!

Shell.run Error Codes

The first step is always read the docs and when they are silent, the second step is to ask your friends. It returns 0 (meaning Running) Fixed at stackoverflow.com/questions/32920690/… –ChrisJJ Oct 19 at 22:23 | show 1 more comment Your Answer draft saved draft discarded Sign up or log in Sign Wscript.shell Run Return Code Why do I get a -2 with a scripting shell but an apparentlysuccessful execution when run from a command prompt? Vbscript Run Command Get Output Help with a prime number spiral which turns 90 degrees at each prime Is there a toy example of an axiomatically defined system/ structure?

I am on W3K3/IIS6 and the only thing I can think of is that there is some policy setting or some other security option that is preventing scripts from being run. check over here Does anyone have any pointers, I have been googling for ages but nothing. The interpretation of that error code depends entirely on that program. The code below return me 100if there is an error and 0 if success. Vbscript Return Code

windows-server-2012 wsh share|improve this question edited Jun 11 '14 at 10:03 Noelkd 3,67521734 asked Sep 27 '13 at 8:52 Krasi Kalincheva 12 add a comment| 1 Answer 1 active oldest votes Always remember Search is your friend. #3 buffalokml Total Posts : 15 Scores: 0 Reward points : 0 Joined: 4/3/2006 Status: offline RE: return value for run method Monday, August Why? http://getbetabox.com/return-code/r04-ach-return-code.html Thursday, May 19, 2011 1:20 AM (permalink) 0 This worked for me if I called the function and passed it the username and server variables.    Function UserQuery(username,server)      Dim WshShell,cmdResult      Set WshShell = WScript.CreateObject("WScript.Shell")      cmdResult = wshShell.Run ("cmd.exe /c  query user " & username & " /server:" & server & " > " & strDirectory & strFileOut)      WScript.Echo cmdresult

Glad you found the problem, though it is ironic that if you had posted the code you were actually working with here, it probably could have also been found here. asked 3 years ago viewed 1366 times active 2 years ago Related 2Team City MSTest runner exits with not zero code - Symantec1Return code of scheduled task prefixed with 0x8007000 in If not, I can always use a sleep function, but I am trying to avoid this.

But if the job didnt trigger (started) also it is showing success.

Your original code had %comspec% /c in Go to Solution 6 4 2 +1 4 Participants TakedaT(6 comments) LVL 10 VB Script9 Scripting Languages3 cusas76(4 comments) CitizenRon(2 comments) LVL 7 VB However, the DI Admin console showed the job executed successfully without any errors. I am now curious if using the code I originally posted if I can get the return code from the oShell.run after the loop. This is because of the 'True' at the end.

http://msdn.microsoft.com/en-us/library/d5fk67ky.aspx 0 Message Author Comment by:cusas76 ID: 328933512010-06-01 Sorry, I thought I had attached it. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl… Document Imaging Document Management Adobe Acrobat Programming Scripting Languages Advertise Edited by cjm51213 Monday, September 03, 2012 9:55 PM Monday, September 03, 2012 9:55 PM Reply | Quote Answers 0 Sign in to vote I ran wbadmin get status in an weblink That means there was error executing the command.

Question has a verified solution. vbscript share|improve this question asked Sep 8 '14 at 23:11 user2717144 36 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote Not sure if this is Why call it a "major" revision if the suggested changes are seemingly minor? Why study finite-dimensional vector spaces in the abstract if they are all isomorphic to R^n?

Search this topic...|Search DI: Designer and Job Design...|Search Box Select a search Explain These Choices... --------------------Recent Topics (All Forums) Unanswered Posts Register or Login to Post Forum Index -> Data More importantly, how do I go about diagnosing this? Get 1:1 Help Now Advertise Here Enjoyed your answer? BODI-1250101:180003 : Schedule service has not been started.