Tool or IDE to debug VB Script code - asp.net

I need any tool or IDE environment to debug and test the vb scripts code. Please suggest any free ones. My vb scripts are standalone (vbs extenstion).

VBSEdit
Not free, but has an unlimited trial period with a nag screen.

Sadly not free....How to debug Windows Script Host, VBScript, and JScript files

I think you'll have a hard time finding a free tool that supports real VBS debugging. But I've used this "poor man's technique" in the past. Create a variable at the beginning of your script
blnDebug=False
Then throughout your script add lines to echo what the script is doing or the value of different variables:
if blnDebug Then wscript.echo "Now starting script strFoo=" & strFoo
When you set blnDebug=True then all your debug messages will be written to the console (I always use CScript when running this). By adding these debug messages as you write your script, you can have debugging available simply by changing the bldDebug value.
Certainly commercial editors like PrimalScript include a debugger. SAPIEN also has a standalone debugger, http://www.primalscope.com/, that while not free is a relatively inexpensive option. You can download an eval copy to try it out.

There is a really old tool called Script Debugger for Windows NT 4.0 and Later. It is designed for VBScripts running in web pages but you can attach it to a vbs script easy enough.
You can download it from here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=2f465be0-94fd-4569-b3c4-dffdf19ccd99&displaylang=en
The name says NT 4.0 I know but I am currently running it on Windows 7 x64 and hod no problems opening the debugger.
Simply install the above tool then run your script from the commandline like:
wscript.exe myscript.vbs //d //x
Once the debugger opens you can step through code and even open a command window where you can check variable values by typeing ? Varname.

Related

When does System.out not appear in the Java console?

I understood that anything to standard out (System.out) would appear in the Java Console window (when it's enabled). I spotted somewhere though that there might be situations where this isn't try, for example, from Swing apps. Is that the case?
Basically, what situations or setups wouldn't I expect to see standard output in the console? Is there a difference in behavior running on the JDK rather than explicitly on the JRE for example? javaw.exe?
ps, I understand how to display the Console in the Java settings but I'm curious as I've managed to create an application, run as an executable jar, that doesn't start the console despite some calls to System.out) on Windows 7.
The only way you wouldn't see System.out output in the console is if the method System.setOut has been invoked. This method is invoked to redirect output to the graphical Java Console, but I don't know of any other realistic circumstance in which it would be redirected away from the Java Console unless you do so voluntarily.
Depending on terminal settings it can happen that the output is not written until a newline character is sent as well. So if you do System.out.print("test") it might not appear immediately.
On Windows this is usually not the case, but on Unix terminals this is quite common.
Perhaps you use javaw to start virtual machine, this version will not show console messages. You can use java to start the virtual machine, which will show the console message.
javaw is intended for apps with windows, java is intended for console apps.
Same thing happened to me. I could not get System.out.println or Logger.debug either on console.
If you are on a huge project in Eclipse or whatever, you can read below.
Solution: I realized that I had not committed jars and some java files to SubVersioN on network. thats all. Project had not been compiled.
One situation I can think of is to invoke System.setOut(null) (orSystem.setOut(any OutputStream other than System.out or System.err)) then the console, if exists, would show nothing.

Qt IDE c/c++Debugger mode is Very Slow?

I'm using the Qt for developing the c/c++ application,while i try to debug the app with static library it is very slow and takes much time step over (r) in..
can any one suggest me to make the debugger fast as like vs2008..
regards
VS
It is likely you are having this behaviour because the debugger retrieves required debug info for system libraries from the internet each time - or it doesn't find the requested info at all. If so, it will display something like that in the Debugging Window.
Follow these steps to set up a symbol cache which will allow caching debug symbols:
http://doc.qt.io/qtcreator/creator-debugger-engines.html#setting-cdb-paths-on-windows
This might still make it slow for the next time you debug, but it should get quite fast from the second time on.
If you do not have internet access though, you will need to manually download these symbols from here:
http://msdn.microsoft.com/en-us/windows/hardware/gg463028.aspx
and place them in the symbol cache folder you specified.
it has nothing to do with windows and debug symbols server
this is happening when libqt has debug symbols and it happens even (directly) in gdb/cgdb!
it has to do with dwarf (still looking into this one)
regressed on windows (8), ubuntu (13.04), fedora (19-rc) & mac (10.8.5 & 10.9) -> obviously has little to do with os or library

log4net with asp.net mvc - can't watch file for changes

So in a console .Net application I can watch all my log4net events stream by with (the powershell command) get-content .\log.log -Wait which is similar to the linux tail command and I assume uses FileSystemWatcher under the hood.
For some reason, whenever I have an asp.net Mvc application this will not work. To be clear, the log file IS written to. I can get-content .\log.log as many times as I want and get the most recent results, but with the -wait parameter I never see the changes scroll past.
Does anyone have any insight into what might be going on here?
UPDATE: found a working solution for my case, not sure whether this would help you out.
Instead of using PowerShell, I downloaded win-bash and now I'm using this familiar Unix command which works perfectly for me.
tail -f access.log
I'm not that familiar with .Net programming. Could it be a working solution in your case to use win-bash project's bash.exe instead of PowerShell?
I am experiencing similar issue when trying to "tail" Apache access log in PowerShell.
Get-Content .\access.log -Wait
I noticed that when my Apache HTTP server is running, it has a handle open to acccess.log and -Wait doesn't work. Stopping HTTP server releases the handle and when I made manual changes to access.log using text editor my PowerShell window immediately reflected changes in the console.
So I assume if some other program has a handle open to the file, changes are not reflected to console. Unfortunately I haven't found a way around this issue so far.

QProcess::startDetached blocked by UAC (running an updater)

I have an update function in my app - it downloads and verifies the installer (a setup.exe, created with NSIS). To actually kick off the update, I have simply been doing:
QString path = .. absolute path to the downloaded file ...
QProcess::startDetached(path, QStringList());
This works fine on XP - but on Vista and Win7, nothing happens once the download completes. If I browse to the downloaded update and run it manually, it works fine. I assume what's happening is that UAC is blocking the installer at CreateProcess time, but this is where my knowledge runs out.
Additional complication - when I'm running a debug build from the command line, the steps above work - I get the UAC prompt and can run the installer. It's the release builds, started form the start menu/shortcut, which have the issue - I assume there's a difference in the auth token when running from a command shell.
You can also use
QDesktopServices::openUrl(QUrl::fromLocalFile(path));
Might be surprising and counterintuitive, but it works and is more cross-platform
If you are not admin and you call CreateProcess() on a .exe with a "Vista" manifest (or no manifest, but a .exe that windows detects as an installer (This includes NSIS)) the call fails, you need to use ShellExecute[Ex](). ShellExecute will trigger UAC prompt if required...
This seems to be a Qt bug, see QTBUG-9761 , the correct workaround is to use ShellExecute with lpOperation set to runas.
Another alternative is to prepend your execution with cmd.exe /C. This effectively routes your execution through the shell, so you do get the UAC prompt. The downside is that if your process fails you probably won't get as much information had you gone through ShellExecute[Ex], but on the plus side you will get all the facilities of QProcess that you miss if you use QDesktopServices::openUrl, where you have no idea if things worked or not.

Run BAT file from Adobe AIR?

To package an .air file into a native installer you have to use a batch program called adt.
The command on Windows will look something like this:
C:\Users\jisaacks>"C:\Program Files
(x86)\Adobe\Adobe Flash Builder
4\sdks\4.1.0\bin\adt" -package -target
native "D:\DEV\Flex4\Workspaces\AIR
Native Packager\AIRNIP\AIRNIP.exe"
"D:\DEV\Flex4\Workspaces\AIR Native
Packager\AIRNIP\AIRNIP.air"
I am trying to author a program in AIR that does this for you. Basically you drag/drop an .air file into it and it packages it into a native installer.
Well It gave me an Error #3219 error, which I looked up and found this:
AIR on Windows does not allow you to
run .bat files directly. Windows .bat
files are executed by the command
interpreter application (cmd.exe).
When you invoke a .bat file, this
command application can interpret
arguments passed to the command as
additional applications to launch. A
malicious injection of extra
characters in the argument string
could cause cmd.exe to execute a
harmful or insecure application. For
example, without proper data
validation, your AIR application may
call myBat.bat myArguments
c:/evil.exe. The command application
would launch the evil.exe application
in addition to running your batch
file.
If you call the start() method with a
.bat file, the NativeProcess object
throws an exception. The message
property of the Error object contains
the string "Error #3219: The
NativeProcess could not be started."
I am wondering if there is a possible work around or if I have hit a brick wall?
I believe you have hit a brick wall, at least with trying to do this in Adobe Air. Executing batch files can be a huge security hole, as your post claimed.
Are you trying to do this in Air for portability, or would you be able to use some other language?
I suggest trying to code this in python. Using the subprocesslibrary can help a lot.
http://docs.python.org/release/2.5.2/lib/module-subprocess.html
Serge Jespers (Adobe Evangelist) (http://www.webkitchen.be/) has done exactly this,
I think you should try to contact him for the details.
I helped him build a first solution by creating a windows executable which executed any bat file you specified, later he changed it by calling the java application (adt) directly which works fine as well.
He'll be very happy to help you.
UPDATE:
You can download the Package Assitant Pro right here: http://www.webkitchen.be/package-assistant-pro/

Resources