Objshell Run Error 160
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads windows error codes list with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack
Windows Exit Code
Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign
Process.exit Code Values
up Capture VBS objshell.Run error up vote 1 down vote favorite 1 I have the below bit of VBS which calls, and runs, a *.sql query via SQLCMD. How can I improve the error checking? If I delete the *.sql file
Sccm Exit Code
it thinks it has completed successfully even though it can't have had. Writelog "Attempting to run *.sql" err = objshell.Run ("cmd /c sqlcmd -U sa -P Password -i c:\temp\abc.sql",1,FALSE) If err <> 0 Then WriteLog "Error running SQL = " & err & "(" & err.description & ")" Else WriteLog "Successfully run SQL" End If vbscript sqlcmd share|improve this question asked Mar 19 at 11:08 Qazxswe 546 4 Read help bWaitOnReturn Optional. Boolean value indicating whether the script should wait for the autosys exit codes program to finish executing before continuing to the next statement in your script. If set to true, script execution halts until the program finishes, and Run returns any error code returned by the program. If set to false (the default), the Run method returns immediately after starting the program, automatically returning 0 (not to be interpreted as an error code). –Noodles Mar 19 at 11:49 Perfect - many thanks –Qazxswe Mar 19 at 13:24 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote accepted As @Noodles pointed out in the comments to your question you need to set the third parameter of the Run method (bWaitOnReturn) to True so that your VBScript waits for the external command to complete. However, that alone doesn't suffice. You also need to run sqlcmd with the additional parameter -b to make it return a non-zero exit code in case of an error: -b Specifies that sqlcmd exits and returns a DOS ERRORLEVEL value when an error occurs. The value that is returned to the DOS ERRORLEVEL variable is 1 when the SQL Server error message has a severity level greater than 10; otherwise, the value returned is 0. If the -V option has been set in addition to -b, sqlcmd will not report an error if the severity level is lower than the values set using -V. Command prompt batch files can test the value of ERRORLEVEL and handle the error appropriately. sqlcmd does not
FORUMSFOR COMPUTER PROFESSIONALS Log In Come Join Us! bigfix exit codes Are you aComputer / IT professional?Join Tek-Tips Forums! Talk exit code 129 linux With Other Members Be Notified Of ResponsesTo Your Posts Keyword Search One-Click Access bigfix exit code list To YourFavorite Forums Automated SignaturesOn Your Posts Best Of All, It's Free! Join Us! *Tek-Tips's functionality depends on members receiving e-mail. http://stackoverflow.com/questions/36100939/capture-vbs-objshell-run-error By joining you are opting in to receive e-mail. Posting Guidelines Promoting, selling, recruiting, coursework and thesis posting is forbidden.Tek-Tips Posting Policies Jobs Jobs from Indeed What: Where: jobs by Link To This Forum! Add Stickiness To Your Site By Linking To This Professionally http://www.tek-tips.com/viewthread.cfm?qid=823804 Managed Technical Forum.Just copy and paste the BBCode HTML Markdown MediaWiki reStructuredText code below into your site. VBScript Forum at Tek-Tips HomeForumsProgrammersLanguagesVBScript Forum Vbscript/Shell will not execute get Error on page. thread329-823804 Forum Search FAQs Links MVPs Vbscript/Shell will not execute get Error on page. Vbscript/Shell will not execute get Error on page. vemate (Programmer) (OP) 19 Apr 04 14:36 Why will this vbscript/shell not execute code as follows:
I get error on page and I do n
5) Bandwidth Analyzer 6) Secunia 7) Net-SNMP 8) Permission Analyzer 9) DNS Stuff 10) WinDiff's Compare Short computer jokes Guy's Scripting Ezine http://www.computerperformance.co.uk/ezine/ezine80.htm 80 - ComSpec and CMD VBScript ComSpec and CMDThis week's Ezine describes http://www.edugeek.net/forums/windows/print-33732-auto-log-off-user-after-program-closed-2.html how to script relatively simple events at the command line. Even though the tasks are straightforward, the syntax can catch you out, unless you pay attention to the speech marks and ampersands. This Week's Secret Scenario: You want to run a command prompt Example 1 - To open a exit code CMD or 'Dos Box'.Example 2 - To add commands to the 'Dos Box'. Example 3 - To pipe the Output to a text file Summary of ComSpec ♣ This Week's SecretWhen I want a script that will open a Dos box, I cannot make up my mind whether ComSpec is better than plain cmd. As ever, knowledge is power, so let bigfix exit code us first find out a little more about ComSpec. Open the System Icon by pressing the Windows key and Pause/Break, navigate to the Advanced Tab, Click on Environmental Variables button, and lo and behold - ComSpec is listed as System Environmental Variable. It turns out to be merely a placeholder for cmd.exe.The nuance is that you could set ComSpec to call another program. To digress, you could even add more environmental variables.You may ask, 'What is the relevance of ComSpec to scripting?' The answer is for controlling VBScripts that employ .Run commands. My dilemma is that SendKeys in Ezine 26 was very popular and so deservers more attention, on the other hand I worry about SendKeys because one wrong instruction and you could get disastrous results. For example, your intention is to delete all internet temporary files. You navigate to the desired directory and then issue *.*. Imagine your horror if you were in the wrong directory when you issued *.* UGhhhhhhhh. This Week's Secret is this, by comparing plain objShell.run cmd with fancy objShell.run %ComSpec%, it literally gave me pe
you want to edit the reg after the change you can simple load up the user.dat reg file from the game users profile in regedit and change it from within the administrator account. 9th April 2009, 05:11 PM link470 Quote: Originally Posted by SYNACK If you want to edit the reg after the change you can simple load up the user.dat reg file from the game users profile in regedit and change it from within the administrator account. Awesome. Never done that attempt before, I'll give that a shot, thanks! And ya I ended up disabling the screensaver on that account or setting the value to 1 in regedit if I want to do maintenance. So at the moment it's 1, then I'll hide it again later when the consoles actually ready. Thanks guys! I'll let you know how it goes. Next steps are to install the games, make sure the logging on and logging off work seamlessly with the game start and quit, and then test imaging. 10th April 2009, 11:42 AM link470 Hmm, I'd really like to use the User Shell idea, but I think VB may be what I have to go with. I set the game as the user shell and the game doesn't run, and gives the error "could not initialize graphics system. make sure that your video card and driver are compatible with directdraw". As soon as I CTRL+ALT+DEL and run Explorer, select the game from the start menu, it launches fine. Must be dependant on something in explorer...unless I'm missing something. Also, after that error, it doesn't log me back out. Maybe I have to quit the game properly to log out, but at the moment since I'm getting the error I have to CTRL+ALT+DEL and choose log out from the task manager Shut Down menu. Any suggestions? If not I'll try VB next. Thanks! ::EDIT:: Just tried with Starcraft, same thing. They both give errors related to being unable to change video settings when they're set as User Shell. As soon as you start up Explorer.exe and then launch the game, it works perfectly. Starcrafts specific error has lots of information on changing screen resolution etc. or updating DirectX, which isn't what we need of course. But it lists the specific error if that helps. The error encountered while trying to switch video modes