vbscript

How to open Notepad text file and keep on top of all other windows until i close it in VBScript?

旧街凉风 提交于 2021-02-19 08:34:17
问题 I would like to create a vbscript to open a notepad text file I saved and keep this notepad text file on top of all other windows either until i minimise it or close it. I want to create a reminder in tasks then so it pops up every 30 minutes or so and reminds me but so when i browse it does not go in the background. Greatly appreciate any help. Dim oShell Set oShell = WScript.CreateObject ("WScript.Shell") oShell.run "notepad.exe C:\Users\***USER***\AppData\Roaming\Microsoft\Windows\Start

How can I make a VBS Message Box appear in a random place?

这一生的挚爱 提交于 2021-02-19 08:09:26
问题 In VBS script, I have created a simple message box application. It currently stays in front of all windows until the user responds and uses very simple coding X=MsgBox("Test Text" ,1+4069, "Test Title") But it always appears in the same place. Is there any way of making it appear in a random place on the screen? Please help! 回答1: There is one type of box which allows you to position it on the screen: InputBox Title = "Hello" DefaultValueText = "Hello Stackoverflow !" message = "Type something

Open programs from HTA application

萝らか妹 提交于 2021-02-19 06:00:19
问题 I'm trying to create a HTA application, that can open programs(exe, bat etc..) locally on the computer. This will be used on a Kiosk PC, where the users don't have access to the desktop etc. But have some problems, with finding a script that works.. Right now I'm using this script: <script type="text/javascript"> function runApp(which) { WshShell = new ActiveXObject("WScript.Shell"); WshShell.Run (which,1,true); } </script> And this is how my links looks: <a href="javascript:window.location

Task Scheduler Problem - Run whether user is logged on or not is not working

蹲街弑〆低调 提交于 2021-02-19 03:36:06
问题 I have a batch file which in turn calls VB Script. The task of the VBScript contains a macro whose job is to login into the Oracle db, run few queries, fetch the output in Excel sheet and then it performs other functions. The script is running fine in the scheduler when using the "Run only when user is logged in" option but it doesn't run when "Run whether user logged in or not" option is selected. I tried all the options suggested here in previous posts but none of them worked. 回答1: I

Same macro for multiple textboxes on the same userform excel vba

笑着哭i 提交于 2021-02-18 19:10:13
问题 I am currently making an userform in which I got multiple textboxes. So for now I got a total of 15 textboxes and each of them should only contain numerical values. The code I got now for each TextBox is: Private Sub TextBox1_Change() If TypeName(Me.ActiveControl) = "TextBox" Then With Me.ActiveControl If Not IsNumeric(.Value) And .Value <> vbNullString Then MsgBox "Sorry, only numbers allowed" .Value = vbNullString End If End With End If End Sub Private Sub TextBox2_Change() If TypeName(Me

Same macro for multiple textboxes on the same userform excel vba

我的梦境 提交于 2021-02-18 19:09:44
问题 I am currently making an userform in which I got multiple textboxes. So for now I got a total of 15 textboxes and each of them should only contain numerical values. The code I got now for each TextBox is: Private Sub TextBox1_Change() If TypeName(Me.ActiveControl) = "TextBox" Then With Me.ActiveControl If Not IsNumeric(.Value) And .Value <> vbNullString Then MsgBox "Sorry, only numbers allowed" .Value = vbNullString End If End With End If End Sub Private Sub TextBox2_Change() If TypeName(Me

Same macro for multiple textboxes on the same userform excel vba

拈花ヽ惹草 提交于 2021-02-18 19:09:16
问题 I am currently making an userform in which I got multiple textboxes. So for now I got a total of 15 textboxes and each of them should only contain numerical values. The code I got now for each TextBox is: Private Sub TextBox1_Change() If TypeName(Me.ActiveControl) = "TextBox" Then With Me.ActiveControl If Not IsNumeric(.Value) And .Value <> vbNullString Then MsgBox "Sorry, only numbers allowed" .Value = vbNullString End If End With End If End Sub Private Sub TextBox2_Change() If TypeName(Me

Same macro for multiple textboxes on the same userform excel vba

本小妞迷上赌 提交于 2021-02-18 19:08:32
问题 I am currently making an userform in which I got multiple textboxes. So for now I got a total of 15 textboxes and each of them should only contain numerical values. The code I got now for each TextBox is: Private Sub TextBox1_Change() If TypeName(Me.ActiveControl) = "TextBox" Then With Me.ActiveControl If Not IsNumeric(.Value) And .Value <> vbNullString Then MsgBox "Sorry, only numbers allowed" .Value = vbNullString End If End With End If End Sub Private Sub TextBox2_Change() If TypeName(Me

Same macro for multiple textboxes on the same userform excel vba

耗尽温柔 提交于 2021-02-18 19:08:28
问题 I am currently making an userform in which I got multiple textboxes. So for now I got a total of 15 textboxes and each of them should only contain numerical values. The code I got now for each TextBox is: Private Sub TextBox1_Change() If TypeName(Me.ActiveControl) = "TextBox" Then With Me.ActiveControl If Not IsNumeric(.Value) And .Value <> vbNullString Then MsgBox "Sorry, only numbers allowed" .Value = vbNullString End If End With End If End Sub Private Sub TextBox2_Change() If TypeName(Me

Anti-locking method in VB Scripting?

天涯浪子 提交于 2021-02-18 18:37:10
问题 If system locks every 5 minutes, what VB Scripting method is used to avoid system locking every 5 minutes? 回答1: Save this file in the format of .vbs Change the Sleep Time 400 based on your requirement. Set wshShell =wscript.CreateObject("WScript.Shell") do wscript.sleep 400 wshshell.sendkeys "{SCROLLLOCK}" wscript.sleep 400 loop 回答2: Perhaps, WScript.SendKeys could help: msdn Something like double-ScrollLock, I guess? PS. You'll need to put that in a loop with a sleep, of course. 回答3: The