VB Script

37K

Solutions

20K

Contributors

VBScript (Visual Basic Scripting Edition) is an interpreted scripting language developed by Microsoft that is modeled on Visual Basic, but with some important differences. VBScript is commonly used for automating administrative and other tasks in Windows operating systems (by means of the Windows Script Host) and for server-side scripting in ASP web applications. It is also used for client-side scripting in Internet Explorer, specifically in intranet web applications.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hello. In an excel spreadsheet I have in  column A many rows that contain text cells. In some of these cells, I have inserted a web link. Others don't have any link.
I am looking for a macro that will write the URL in column B for each cell that has text + link
Ex : if A1 contains the text "Google" with a link to "www.google.com", then the macro will write in B1 "www.google.com"
The macro will screen all the non empty cells in column A and will write the URL only if there is one
Thanks
0
how to write a VBS script  in windows server executing below list of commands to run through  windows admin console

===
title ADF-SERVER
SET USER_MEM_ARGS=-Xms24576m -Xmx24576m -XX:PermSize=10240m -XX:MaxPermSize=10240m
C:\Oracle\Middleware\user_projects\domains\ABC\bin\startManagedWebLogic.cmd ADF-SERVER

================
0
I have a script in outlook 2016/2019, that popup a dialog box to choose a folder in which the mail should be saved after I send the email.
This works good.

I have additional settings in the outlook that makes me "save the reply in the same folder".
save the reply in the same folder
Now I want that the dialog box (as per the script) should popup, only when I am not replying to a mail from a folder. (except inbox)
 i.e the dialog box to choose folder should popup, only when I am composing a new email or when I am replying to email from inbox.




http://www.outlookcode.com/article.aspx?id=48
Code source

Private Sub Application_ItemSend(ByVal Item As Object, _
                                 Cancel As Boolean)
    Dim objNS As NameSpace
    Dim objFolder As MAPIFolder
    On Error Resume Next
    Set objNS = Application.Session
    If Item.Class = olMail Then
        Set objFolder = objNS.PickFolder
        If Not objFolder Is Nothing And _
          IsInDefaultStore(objFolder) And _
          objFolder.DefaultItemType = olmailitem Then
            Set Item.SaveSentMessageFolder = objFolder
        Else
            Set objFolder = _
              objNS.GetDefaultFolder(olFolderSentMail)
            Set Item.SaveSentMessageFolder = objFolder
        End If
    End If
    Set objFolder = Nothing
    Set objNS = Nothing
End Sub

Public Function IsInDefaultStore(objOL As Object) As Boolean
    Dim objApp As 

Open in new window

0
Hello,

I am trying to find a excel VBA code that can highlight an entire row based on the values from a different sheet. For example, I have a worksheet named "Subject" which has a list of values. I have another worksheet named "Email" that has columns like "Sender" and "Subject". I want the rows in "Email" sheet to be highlighted if it finds one of the matching values from the Subject sheet. The challenge I am having is, the subject line will not be an exact match. I am looking for if the rows that CONTAINS or LIKE based operation. If it contain one of the value then it should highlight the entire row. One important is to look for case sensitive option(Match case). I tried looking for FIND or VLOOKUP but it doesn't help me.  

I am attaching sample spreadsheet. If anyone can help that would be great!
Thank you
test.xlsx
0
Need a good simple script to download files from a website automatically. The file changes its name from time to time but stays in the same location and it's the only file in that download location. I am not a script writer so, any help to get started would be great or if someone has one that works it would be awesome. The script needs to check daily for updates then download to a folder or a share drive if there is an updated or changed  file available. Not sure how difficult it will be. Thank you.  Or if there is a better way then let me know..

We are currently all Windows 10 Pro & Windows Server 2016 Datacenter.
0
Looking for an alternate to CDO.Message for sending email in a VBScript on Windows Server Core.

NOTE: While we also use PowerShell scripts to send email, we have several substantial legacy VBScripts that carry out tasks and send mail, so fully rewriting these in PowerShell will be a longer term objective. In the interim, we're in need of a workaround to the VBScript issue. Thanks.
1
I work for a small company and have been tasked with building a database application to help with some of our industry-specific tracking needs.  I am NOT a database developer or VB coder.  My experience is limited to industrial PLC programming and the occasional small Python script.  

The project includes a Form that executes an OnCurrent event which calls a Class Module (which I did not write the code for).  The purpose of the code is to acquire the Width and Height dimensions (in pixels) of an on-disk image file.  The code executes correctly if the record includes a valid image path.  However, if there is no valid path, I get the following error:
error_91.PNGat this line of code in my Form:
als315_Mod_Error.PNGHere is the code for the ImageDimensions class module:
Option Compare Database
Option Explicit

Private pPixelWidth As Long
Private pPixelHeight As Long
Private pImageFullPath As String

Public Property Get ImageFullPath() As String
  ImageFullPath = pImageFullPath
End Property
Public Property Let ImageFullPath(fullPath As String)
  pImageFullPath = fullPath
  Dim dimensionsText As String

  dimensionsText = GetImageDimensions(fullPath)
  pPixelWidth = Left$(dimensionsText, InStr(dimensionsText, ",") - 1)
  pPixelHeight = Mid$(dimensionsText, InStr(dimensionsText, ",") + 1)
End Property

Public Property Get PixelWidth() As Long
  PixelWidth = pPixelWidth
End Property
Private Property Let PixelWidth(value As Long)
  pPixelWidth = value

Open in new window

0
What VBA do I need to connect to an Oracle database  without setting up ODBC and without editing TSNAMES.o ra? In this code I also want to specify which Oracle driver to use.
0
I am working on a vb asp.net project that needs to export an excel work sheet into a sql server 2014 table

Not sure the best way to do this

Any advice????
0
Hi Experts,
I am looking for a function that will read a csv file containing employees schedule date & time and identify all the overlapping records.
Below is an example of what the file looks like and what would be considered an overlapping schedule.
UnitCostCenter,EmployeeCode,EmployeeName,StartDate,StartTime,EndTime,Lunch,TotalHours,OnCallFlag,CallBackFlag,ChargeFlag
,A1236       ,J A               ,4/26/2019,3:00:00 AM,11:00:00 AM,1,7,,,
,A1236       ,J A               ,4/25/2019,3:00:00 PM,7:00:00 AM,2,14,,,

"It's because those two TS in the spreadsheet for 4/25/ and 4/26 are overlapped (just put them in correct order - TS 4/25 ends next day at 7AM ):"
Thanks
0
Hello Experts -

I need to help creating  a PowerShell script to ping a device name (i.e. devicename.domain.com) every 15 min using scheduled task and then send popup message when it comes up on the network. Can somebody help me create a script to complete this function...  thanks...
0
Hello Experts

At the moment we are running a batch file on every computer to empty the downloads folder every week, but it deletes only the files but not the folders.
could you be able to help me by creating a new batch file that clears all the contents of the downloads folder for all the user's profiles on the PCs?
we would like to know as well if we can add this on the group policy and it can deploy to all the users in the company.

Here is the one we are using which we are running from a scheduled task list.

forfiles /p "C:\Users\PofileName\Downloads" /s /m *.* /c "cmd /c Del @path" /D -0

Thank you very much.
0
Need some help with deciphering this vbscript... this script first runs a dsquery to grab all users and DN's into a file.

Basically line 12, I'm looking to grab the DN where it builds a strNullset variable to determine if @Domain or @Domain2.org - is there a way to do this in powershell without dumping out all of the users in a file, then append later in the script?

Also looking for what line 24 actually does with the "2", and also what line 29 does... ?




Set objArgs = WScript.Arguments

If objArgs.Count < 1 Then
	Wscript.Quit -1
End If
Const ADS_PROPERTY_APPEND = 3
strUserDN = objArgs(0)

Set objUser = GetObject("LDAP://" & strUserDN)
If UCase(objUser.AccountDisabled) = "FALSE" Then 
	strNullSet = objUser.sAMAccountName & "@Domain.org" 
	If InStr(UCase(strUserDN),"Domain2") Then   
		strNullSet = objUser.sAMAccountName & "@Domain2.org"
		End If
	If objUser.mail = "" Then                             
		If objUser.userPrincipalName = strNullSet Then 
		Else
			objUser.put "userPrincipalName", strNullSet    
			WScript.Echo objUser.sAMAccountName & "," & strNullSet & "," & objUser.userPrincipalName & "," & "Null"
		End If
	Else
		If objUser.userPrincipalName = objUser.mail Then  
			strO365Alias = "smtp:" & objUser.sAMAccountName & "@cchs.mail.onmicrosoft.com"
			If objUser.mailNickname = objUser.sAMAccountName & "2" Then
				strO365Alias = "smtp:" & objUser.sAMAccountName & "2@mail"
			End If
			objUser.PutEx ADS_PROPERTY_APPEND, "proxyAddresses", 

Open in new window

0
Hello experts,
I am looking for a script to :
-Upload file to an url
-Download specific and last modified file from a url
To access to this url I need to report credentials. User and password.
I heard about cUrl application however if this is possible through a build-in language such as powershell or vbscript I a prefer this approach.
As regards the upload and the download the script should manage success and error actions in a log file.
Thank you in advance for your feedback.
0
Hi Experts,

I need to fill the data in an Online Form using the Data in Range F4:F20 from the attached InputData Sheet as Input Value.
The Website Address is
https://onlineservices.tin.egov-nsdl.com/etaxnew/tdsnontds.jsp

There are links to 11 Forms on the above page.  Presently the Data given in Sheet is only for ITNS 281. Kindly make a provision in the code so that it opens the Form Name mentioned in Cell F1. I will try myself to amend the code given by you to open and fill those other forms too and fill the Input Fields.

Of Course, I will fill the Captcha Manually
(I am not sure Whether Captcha can be handled via a Code or Not ? If Yes, then we need to enter the Captcha and press "Proceed"
Definitely will be delighted if Captcha can be handled via code otherwise I it has to be done manually.)

I have also given a screen shot of the Form filled with the Data as per Sheet.
When I press a Button in the Excel Sheet
--the new browser window will open and site will be opened in the browser
--the required Form is Selected and
--the Data is filled from Range F4:F20

No personal choice regarding browser to be used, but it would be great if the same can be accomplished using Chrome, Firefox or Internet Explorer (in no particular order)

Regards
Kanwaljit
Online-Fill-01.xlsx
ITNS-281.png
0
This is in addition to another question I asked earlier. The previous question I need data looked up on one tab and copied over the updated status on the other tab. Martin Liss created a nice Macro for me.

https://www.experts-exchange.com/questions/29145206/How-do-I-update-Excel-data-in-a-column-with-a-Macro-or-VB-Script.html

What I need with this is, if the machine does not exist on the SCCM DATA TAB then copy the whole row from Raw Data over to the SCCM DATA tab. Everything from Column A thru H has to be copied to SCCM DATA Tab.
0
we have some remote PCs that contain users outlook pst files.

is there any script (powershell, wmic, vbs, etc) to get for each user in that remote PC , the path of the pst files mounted in Outlook (2010, 2013, 2016)?
0
I have a spreadsheet that has 2 TABS, SCCM DATA and RAW DATA, both have Source Computer (Column A) and Migration Status (Column F), everyday I copy the raw data over from SCCM to RAW DATA, after I copy the raw data from SCCM, I would like a Macro to compare the Source computer info on RAW DATA with SCCM DATA, if the Migration Status is different, then copy the updated Migration Status to SCCM DATA.

For Example: SCCM DATA                                                  For Example: RAW DATA
Source Computer     Migration Status                             Source Computer             Migration Status
Xhostname                 Not Started                                      xhostname                       completed

so what I need is the macro to do is update the migration status of SCCM DATA with the RAW DATA Migration Status. If there is no change then do nothing.

Thank you in advance.
0
I am looking for a batch, VB or Powershell script that can parse a file name for a date, and then delete that file if the Date is older than 90 days. Files will be in subfolders, so the script would need to be able to drill down into the subfolders.
Here example of file names:

2019-01-02T080219~queue~520118152~+520118152~311242d8-10ea-49ae-869c-81a43434d40b.WAV
2018-05-10T112639~call~1004~605191811~c97043a6-2bfe-44c8-bde4-b0c3596ede60.WAV
2018-05-02T144725~call~1005~151981173112~a272d339-d85e-4742-a6d0-a988ba6594ea.WAV
2018-10-23T144526~call~2411~18189199~6774130d-a249-4c18-8700-8c629bdf3841.WAV
1
Hello experts,

I am looking for a batch, powershell or vbscript to cover the following requirement:

-Loop a reported folder with drill down
-Check the various files and folder
-Replace SourceString by TargetString
-SourceString and TargetString should be reported as parameter

-Example:
BaseDir= C:\Test
SourceString= “_”
TargetString “-“

-Various files and folders which contains source string “_” should be replaced by target  “-“.

If you have questions, please contact me.
Thank you.
1
Hello experts,

I am looking for a batch, powershell or vbscript to cover the following requirement:

Loop a reported folder (no drill down needed):
-Rename the various files with reported folder name and add a numbering based on modified date from oldest to newest
-Example:
BaseDir= “C:\toto” contains filea.csv filea.xls fileb.csv
Expected result is the following:
toto-1.csv, toto-2.xls, toto-3.csv

If you have questions, please contact me.
Thank you.
0
I am experiencing an SQL 2014 Job Package that is not connecting to MS Access when the package is either scheduled or manually running it. The package connects and runs fine when I developed it in VBS with no errors. The package dtsx was deployed to SSIS in the Integration Services Catalog SSISB.

Connection String value:  Data Source=\\xxxx\xxxx\xxxx\Databases\Mmaster.mdb;Provider=Microsoft.Jet.OLEDB.4.0;
Server Name:  \\xxxx\xxxx\xxxx\Databases\Mmaster.mdb
UserName: admin
Password: [left blank as there is no mdw and the mdb is not password protected]
InitialCatalog: NULL
RetainSameConnection: False

These are the Connections available through the Connection Manager, once I select the OLEDB, then I selected the Microsoft Jet 4.0 OLE DB Provider. It tests and connects with VBS, just not in the SSIS Server Agent Jobs.
Connections-1.jpg Connections-2.jpg
0
Hello Experts,

I'd like to create a list of available dates for employees in excel. We're working on a project and I'm trying to group departments together on the dates they'll be in the office.

I've attached a spreadsheet with an example but need the formula to put it all in place - if not a formula maybe it needs VB code to get it to work as desired?

- I have the dates employees will NOT be available (Unavailable Dates in attached spreadsheet)
- I have a Holidays tab to list Holidays where no one will be available
- I have a weekday calendar that lists all the days of the week

The available dates (Available Dates tab in the spreadsheet) will be produced by looking at the weekday calendar and excluding Dates Unavailable and Holidays. At least that's what I need it to do. Once I get that part working, I can do a pivot table to group the departments on their available dates.

 I hope it all makes sense, thanks!
Available_Project_Dates.xls
0
Hi guys

I'm trying to come up with an effective way of creating a budget planning system that gives myself and the directors an idea of where we are on the project in comparison with the percentage of the budget spent.

Let's say we have signed off £100,000 for a project. We start the project and by the time 20% of the project is completed, we have burned through 50% of the budget already which, which could well be a disaster.

So two things I'm asking is:

a. Is there a way that you could apply a weighting system which would in turn give you an idea of how much of the project is done? Basically, a way of measuring the percentage of the project that has been completed/incomplete through entering data in necessary fields/excel sheets.

b. Is there a way of using the budget given to do some sort of comparison with the percentage of project completed, so that you could get an idea of what percentage of the budget we have gone through in comparison to the percentage completion of budget.

All of this would ideally be done in Excel.

Does this make sense? If it does, any input would be great. Perhaps you do it a different way and it has helped you and that input may help a lot too.

Thanks for helping
Yash
0
Hello,

We currently have a scheduled task that runs a script daily. This script is used to synchronise multiple AD security groups with the Adobe cloud. At the moment we have multiple security groups such as Adobe_Photoshop, Adobe_Indesign, etc. When a member of staff is added anyone of these security groups they are allocated a licence the next time the sync occurs. Obviously we can run this hourly but we don't want to run the script that often as it takes time.

Does anyone know how we could monitor security groups for a change and when a change occurs kick off a script? This was we can ensure that we allocate licences to our team without delay.
0

VB Script

37K

Solutions

20K

Contributors

VBScript (Visual Basic Scripting Edition) is an interpreted scripting language developed by Microsoft that is modeled on Visual Basic, but with some important differences. VBScript is commonly used for automating administrative and other tasks in Windows operating systems (by means of the Windows Script Host) and for server-side scripting in ASP web applications. It is also used for client-side scripting in Internet Explorer, specifically in intranet web applications.