vbscript

How should I go about learning to write programs?

I'm 15 years old and I want to learn how to program computers. I like to think I'm more experienced with computers than the average person, I use the command prompt every day and I know how to access the command line in the command prompt but I have no idea what programs I should start with and what language to use. Would I be better off...

Run VBScript in web host environment with no MSScriptControl allowed

At my place of employment, they have a system that uses VBScript to build fields when loading up a record. The advantage is that it works on various database backends the same way and also makes sure that the record is loaded the same every time. It also allows customers access to make some minor changes to the way the system works in ...

VBS Computer Info Script

Can someone help me modify this please? Instead of the dialog box appearing at the start to ask for computer ID/Name, is there anyway for this to be automatically put in, so its all automatic? And at the end, not to open the file, just to have it stored on the hdd (same dir as script) On Error Resume Next Const HKEY_CURRENT_USER = &H800...

Use Microsoft Scripting Control to evaluate 'If' expressions (via c#)

I have some c# code that uses the Microsoft Scripting Control to evaluate some expressions: using MSScriptControl; // references msscript.ocx ScriptControlClass sc = new ScriptControlClass(); sc.Language = "VBScript"; sc.AllowUI = true; try { Console.WriteLine(sc.Eval(txtEx.Text).ToString()); } catch (Exception ex) { Conso...

How can I detect the drive letter of a booted USB drive from script?

I'm launching WinPE 2 from a bootable UFD, and I need to detect the drive letter in order to tell ImageX where to find the WIM. However, depending on the machine I'm imaging, there are different mounted drives. I need a way to consistently mount the UFD at, say, P: or something. Is there a way to detect the letter of the drive from wh...

Time to display OS and time to display recovery options

I really enjoy automating things to make life easier for my self. I have tried looking around on this site as well as just Googling my question but nothing has come up to even point me in the right direction. So here is my question. I would like to: Disable (aka uncheck) Time to display list of operating system. Set Time to display ...

Advice for Windows XP Scripting, WSH versus PowerShell

After much experience scripting in the Unix/Linux open-source world, using languages such as Bourne Shell, Perl, Python, and Ruby, I now find myself needing to do some Windows XP administration scripting. It appears that the legacy environment is Windows Script Host (WSH), which can use various scripting languages, but the primary langua...

programatically add module to xls 2003 using vbscript

The first part is now working [ I have the following which just seems to hang; the part that adds/deletes the module works when running in VBA I note that I'm prompted with a dialog saying 'this workbook contains links to other data sources' which I ok to, then it hangs So I tried setting the second argument to 0 and also tried 2 but sti...

Need to close a windows that does not show in process list via Visual Basic Script

I need to close down a VPN window using visual basic script. My normal port of call would be too look through the process list and close the correspoding process. Unfortunately this does not work in this case as the associated process is explorer.exe! Is there anyway to achieve this? ...

How do I determine real cause of ODBC call failed(3146) with ms-access?

My client is using Access as a front end to a SQL Server database. They recently started getting ODBC - 3146 errors from time to time when running some reports. From what I can tell, this is just a generic ODBC call failed error. I've tried sticking some error handling in the VB script that is launching the reports, but I am not havin...

Force messagebox to foreground

I've got a VBScript that calls a Visual FoxPro Instance and runs a VFP program. Part of this program produces a messagebox. However, if my script is run from the Windows GUI (rather than a Command Prompt), then the message box produced doesn't necessarily come to the foreground. In VBScript I have the following code: Set oVFP = Creat...

Count the number of #defines in a .c file using VBS

I need to count the number of #define lines in C files (3 of them) using VBS. Please suggest the best way to accomplish this. ...

"50289 Can't perform operation since the project is protected" but why?

I am supplying the correct password Set objExcel = CreateObject("Excel.Application") Set objWorkbook = objExcel.Workbooks.Open("H:\M\X\C.xls", 0, , , "password") 'any of these lines cause the error mentioned Set vbcomp = objWorkbook.VBProject.VBComponents(modname) objWorkbook.VBProject.VBComponents.Remove vbcomp objWorkbook.VBProject...

Javascript - getting path of file dropped into HTA

I am building a little HTA for personal use, and would like to be able to drag and drop a file to the interface. Once the file is dropped, I would either automatically run it (assuming it fits some parameters I set, like file extension), or at least fill in the input box on the HTA interface. I've searched extensively, but can't find a ...

Variable in child window does not receive value from parent

From within an html page, I create a child window to perform some filtering (choosing the printer, and what parts to print on the report). In order to show the part selection on the child window, I need to call a GetParts function from the parent window and return the recordset to the child. Here's some code to help: From the child wind...

Keeping VBScript Organized

I maintain a good number of vbscripts for performing various startup scripts on my network and have a handful of functions that I use in almost all of them. Short of copy and paste, does anyone have suggestions for how I can go about creating libraries of reusable vbscript code. I'm not averse to using a code generator for doing so as ...

Why is it that my VBS script file doesn't work when copied to my ASP page?

OK.. I am not really good at asking questions, but the title says it all. I got my script querying Active Directory to work when called from the command windows, but it won't work on my ASP page. Instead of echo("message") in the VBS file, I used Response.Redirect(message) in my ASP. So here's the code that is working fine in the CMD wi...

Setting permissions on a MSMQ queue in script

Can anyone give me some pointers on how to set permissions on MSMQ queues in script, preferably PowerShell, but I'd use VBscript ...

Manupulating Excel files from Windows Scripting Host

Is there a fast way to manipulate the contents of an existing XLS file from Windows Scripting Host? We have Excel templates we received from a customer. Our task is to fill these templates with the data we fetch from an Oracle database. The current approach is to use Windows Scripting Host and VBScript: Get data from Oracle using ADO...

WMI Win32_Process.Create fails with Insufficient Privs

I'm trying to run a simple cmd utility on a remote Windows server from within a vbscript by invoking the Win32_Process class, like so: serverIP = "10.0.0.3" Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & serverIP & "\root\cimv2:Win32_Process") RunCommand = "cmd.exe /c echo hello >c:\hello.txt" wscript.echo RunComm...