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, trying to mimic a strike through text for our retail price field with a line, however when there is no retail price or it is the same as our sale price, I need the line to disappear.  Have been all up and down and around with conditional formatting by setting the retail field to be ON TOP, transparent and then when there is no retail price or retail is same as sale price, condition background to be white so it will cover up the mimic'ed strike through line.  In the conditional setting... I also tell the text to be white and I see that it stays on top and does effect the line - but the background will not do this - even if I try different background colors.  Not sure what to do next... I've seen VB code conditionally make something visual or not, but I'm not versed in VB at all.  Any suggestions?  Thanks, Kevin
conditionalformattingprob.pdf
0
Cloud Class® Course: Microsoft Windows 7 Basic
LVL 12
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

Good Afternoon,

I have uploaded two text files called as follows

Audit_HV_Type.txt

AuditPlot_HV_Type.txt

The main file is called 'Audit_HV_Type' it has a value under the heading Order Number: - the values are like this as example HV_000035_106116

In the other file it is called 'AuditPlot_HV_Type', in this file it contains two key values, 'Order Number' & 'Description'

I want to able to create a process that takes the 'Order Number' taken from file 'AuditPlot_HV_Type' and searches for value in the flle 'Audit_HV_Type' when it finds a match, I would like to append the description value at the end of the order Number. When it finds no match, ignore the line.

Example

File AuditPlot_HV_Type.txt

"HV_000035_1061168","Plot 17 kicker lift "

Searches for 'Order Number' 'HV_000035_1061168' in the file Audit_HV_Type.txt

When it finds a match append the description at the end of the order number

"20 July 2018 01:51 PM","User1","User2 ","HV_000035_1061168_Plot 17 kicker lift","admin@somewhere.com ","Contractor1"

It sounds simple - I hope you understand
0
Hi, Experts, how to achieve this result from the loop of record set, arDataArray = Array("100 Banana", "200 Apple", "300 Orange") . After looping I want the result to be like this, Array("100 Banana", "200 Apple", "300 Orange") 100, 200 and 300 are my Procode, Banana, Apple, and Orange are my Proname

   Set rs = cn.Execute("Select Procode, Proname from ActualCount")
      with rs
         If rs.BOF = True Then 'No record
            'Do nothing
         else
            do until rs.EOF
               arDataArray
            rs.MoveNext          
            loop   
         end if
      end with

Open in new window

0
I installed UFT 14.03. Problem is that it is not recognizing some objects when I record and play .
0
Good Afternoon,

I have a basic bat file with the following code below..

@echo off
D:
CD \
net use T: \\Server\Server1 password /user:user
move /Y "D:\Folder\*.pdf" "T:\Folder1\XXX Inbox XXX\"
net use t: /del

Open in new window



On the line - move /Y "D:\Folder\*.pdf" "T:\Folder1\XXX Inbox XXX\"

I want to be able to put today's date in the format of YYYYMMDD in the first part of the folder structure after folder - see below as an example

move /Y "D:\Folder\YYYYMMDD\*.pdf" "T:\Folder1\XXX Inbox XXX\"
0
Hi, Experts, I'm trying to get an item within the array where I use the first word of the item as its reference. I found a code from asp tutorial that may lead to solve the problem but I'm still not able to solve it. Hoping you (Experts) help me solving this problem. This is my array; fruits = Array("100 Banana","200 Apple","300 Orange") I want to get the orange using 300 as its refrence. I have the code below but I don't know how to make it right. Thank you!

<%
DIM findThis
findThis = "300"
fruits = Array("100 Banana","200 Apple","300 Orange")

If in_array(findThis, fruits, false) Then 
  Response.Write Orange & " is in the array"
Else 
  'Response.Write findThis & " is not in the array"
End If

%>

<%
Function in_array(element, arr, performTrim)
  Dim i
  in_array = False
  For i=0 To Ubound(arr)
    If performTrim Then '//there are some scenarios where you want to trim
      If Trim(arr(i)) = Trim(element) Then
        in_array = True
        Exit Function      
      End If
    Else '//and other scenarios where you don't
      If arr(i) = element Then
        in_array = True
        Exit Function      
     End If
    End If     
  Next
End Function
%>

Open in new window

0
I use this code to connect to a remote server:
<%@ Import Namespace="System.Net" %>
<%

Dim myReq As HttpWebRequest
Dim myResp As HttpWebResponse

myReq = HttpWebRequest.Create("https://google.com/")

myReq.Method = "PUT"
myReq.ContentType = "application/json"
myReq.Headers.add("Authorization", "Bearer e464f18c4e88c690a9ad9d23d051a3b85dae7f81d4edc6d0c590372d286bb5b9")
Dim myData As String = "{""fields"":{""slug"":""onez"",""words"":""hello worldz"",""name"":""Nnnnamez"",""_archived"":false,""_draft"":false, ""zimage"": ""<div>Hello</div>""}}"
myReq.GetRequestStream.Write(System.Text.Encoding.UTF8.GetBytes(myData), 0, System.Text.Encoding.UTF8.GetBytes(myData).Count)
myResp = myReq.GetResponse
Dim myreader As New System.IO.StreamReader(myResp.GetResponseStream)
Dim myText As String
myText = myreader.ReadToEnd

Response.write(myText)

%>

Open in new window

The remote server returns a 405 error code and it also returns content.  How can I get by ASP.NET VB code to grab and return the content that was sent along with the 405 error header?  I want to see the details that the remote error is sending.
0
I would like to use HttpWebRequest and HttpWebResponse with ASP.NET VB.

This gives me an error:
<%

Imports System.Net

Dim myReq As HttpWebRequest
Dim myResp As HttpWebResponse

%>

Open in new window

How can I properly import System.Net?
0
I have the following robocopy script of which is 90 % there but just need it to delete the subfolders from "C:\CHILTERNDOWNLOADS" when the files have transferred.

Any Ideas on the command?

Thanks
Robocopy "C:\CHILTERNDOWNLOADS" "S:\CCTV Downloads\Chiltern Downloads" /S /MOV /R:10 /W:5 /V /ETA

Open in new window

0
Hello to all of you.

I would like your help on a macro on excel

For the attached file, I want a macro that does :

1) it compares all the cells in B column with the number that I have in cell  I1. This number will be 6 in some cases, 5 in others, 7 etc ...

2) when it finds a cell in B column that has a number equal or greater than the cell in I1 (6 in this case), to copy the deg of that cell
in H column of the newSheet8.

for that case of 6, the H column of newSheet8 would have the degs:
3
20
26
33
56
etc


Any help?
0
Introducing Cloud Class® training courses
LVL 12
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Hi guys

I'm completely new to VLOOKUP tables and have been working on some tutorials. I have an Excel sheet that I have attached so that you can see what I am trying to do.

So basically, in worksheet 'User Details' I would like the column 'Organisation' (column C) to be filled in with the data in worksheet 'Mailbox Details' called 'Organisation A (also column )'. If you look at cell C8 in 'User Details', you will see 'contoso.com' which I have manually put in there.

Here's how I am trying to do it:

In the 'User Details' worksheet, the column A6 is the value I am looking up. As an example, my Lookup_value will be 'A8'.
The Table_array will be worksheet 'Mailbox Details' columns 'C5:D29'.
Col_index_num = 1 as that's the column I am trying to extract data from.
Range_Lookup = false

The issue I am seeing though is that in 'Mailbox Details' worksheet, in Column C there is a formula that has been dragged down and perhaps this is causing the issue?

If you're able to help me figure this out, that would be grand.

Thanks for helping
Yashy
ActiveDevicesUsageTracker-07-06-201.xlsx
0
Hello. I use SAP to extract various information from the screen manually. I would like a help with a script (VBA / SAPGUI) that searches the entries in a worksheet and copies the SAP information and saves it in an excel spreadsheet. can you help me?

I enter a transaction (ZPDIS_MM_BMD), with the contract number (4600xxxxxx), which shows a list of projects, then I choose one in the second column of these processes and I click for more information, then it has the information I need, it is not editable . There are several contracts and each contract has a list of projects.
Steps.pdf
0
Visual Studio Asp.net web using vb.  
I am trying to open a directory from my application.  It works perfect when  in debug mode but does not work when I publish to our intranet.  

    Protected Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Process.Start("explorer.exe", "c:\")


Any help would be appreciated.  The application is published on a 2008 r2 server running IIS
0
I am using SCCM to deploy an application.  The app is old school and I have to copy a license folder to the profile of the currently logged on user.  I posted a similar question and instead of help with VBScript I only had suggestions to do it another way so...

No - I can't use AD policy.
No - I can't copy a single use license to every user profile.
No - I don't want to use a batch file because I don't know how to grab the currently logged on user with a batch file.

For the script - so far I can grab the logged on user.  I've also used FSO.CopyFolder before.  What I'm having trouble figuring out how to do is tack the contents of the Username variable (see below) to the end of C:\Users.


 Here is what I have so far....

Option Explicit
Dim FSO, WSHShell, Regkey, Username,

 Set WSHShell = CreateObject("WScript.Shell")
 RegKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\"
 Username = WSHShell.RegRead(RegKey & "LastLoggedOnSAMUser")
 Username = Mid(Username,7)
strFolder = "C:\Users"
 Set FSO = CreateObject("Scripting.FileSystemObject")
 Dim UserPath : UserPath =  ????  <----- How do I make this happen - tack the contents of Username to the end of C:\Users and make UserPath = C:\Users\Username?
 Dim DataFolder : DataFolder = UserPath & "\AppData\Local\FolderA"
 
 FSO.CopyFolder "\\Server\SCCMResources\Applications\FolderA", UserPath & "\AppData\Local\FolderA",1


I'm really not experienced with VBScript but familiar …
0
Need script to identify below files in startup folder on windows workstations

CHKDSK.vbs
Install.vbs
tvn.vbs
opera.browser.uninstall
webengine.dll.man
0
Hi Experts,
I have this question after solving the following..
https://www.experts-exchange.com/questions/29108803/Script-to-read-all-files-of-specific-folder.html#acceptAnswerByMember
In that question I got a script how to count all records of files in one folder.
However now I need to know from that count how many are under one specific category.
Therefore I thought the best way would be to concatenate all files into one, just ignoring the headers.
And from there I will link to MS Access and get the results from a query.
Anyone has either a script for that or another way to accomplish the task?
Thanks in advance.
0
Dear Experts,

I'm looking for an excel macro to auto fill cells in Column B based on selected description from cells in column A. I tried using Vlookup but this is not completely successful.

Example:

Cell A1 - Hollywood/entries/Jan 2018 - result in column B1 should be - Hollywood
Cell A2 - Hwood/entries/Dec 2017 - result in column B2 should be - Hollywood
Cell A3 - Sales/Jan - Result in Column B3 should be - January

in above example, the source is not definite and specific information is sometimes expanded sometimes abbreviated, and this is just example, similar to Hollywood and Jan, the list is exhaustive.

Any help to crack this is highly appreciated.
0
Need a Visual Studio VB script to modify SAPI (5.4) to recognize words such as 'gimmie' in place of 'give me', or 'myname' in place of 'my name'.
I know SAPI provides for this capability; however I am a tcl\tk programmer.

Please advise.
0
I need to find a keyword in a word document title/name so that I can perform an if statement on the result

I have tried the following with a document that had the word "New" in it and this executed in the document open function:

    If ActiveDocument.Name = "New" Then
        MsgBox "New Found"
    Else
        MsgBox "New Not Found"
    End If

As you can guess...it didn't work out and that's why I am here!  :)
0
Upgrade your Question Security!
LVL 12
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Problem:

We are trying to deploy a product with SCCM that requires a registry entry in HKEY_CURRENT_USER for the logged on user.   Yes - it is ridiculous that we can't install this product for "system" but oh well.  In SCCM I can set to ensure that the application only installs when the user is logged so there is that good news but...

From within a script, I need to find out who the currently logged on user is and then add a registry entry to that user's HKEY_CURRENT _USER.

Solution:

I'm half way there with a vbscript.  I was able to find the following script in another post which finds the currently logged on user.  The problem I'm having now is I'm not sure how to run "regedit /s "updateregentry.reg"" and put the entry in that user's hive.

Any help would be appreciated.  Below is the vbscript.

Option Explicit
Dim WSHShell, RegKey, Username
Set WSHShell = CreateObject("WScript.Shell")
RegKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\"
Username = WSHShell.RegRead(RegKey & "LastLoggedOnSAMUser")
Username = Mid(Username,7)
WScript.echo Username

Also - these are the registry entries I'm trying to add:

[HKEY_CURRENT_USER\Software\{08439167-4CA5-48E9-A810-A3A7C0B80B06}]

[HKEY_CURRENT_USER\Software\{08439167-4CA5-48E9-A810-A3A7C0B80B06}\Local]

[HKEY_CURRENT_USER\Software\{08439167-4CA5-48E9-A810-A3A7C0B80B06}\Local\CNS5T2Q540AHCQ6QU75GXH6DS1MCCCXFYF60W-102-292-280-A1]
"SiteMessage"="MyBusiness"
0
Hello, the company has a custom MS Word Macro. I copied the macro from one computer. I saved it to another computer specifically to %Appdata%/Microsoft/word/startup. When I try to run the macro, I got message "run-time error '91':  object variable or with block variable not set. I appreciate your reply :)

I notice I can't open the VBS editor as well from MS Word.

If ever this successfully run, how can I add this custom macro into button at MS Word.
0
Hi Experts,
I am looking for a script that will read all files of a specific folder (.txt,.csv) and count how many records they're in total.
all files have fields header, however some files only contains the header and should not be count.
Thanks in advance.
0
Hi Experts,

I want reformat a large word document (1000 pages) so that, wherever in the document the blue text ( as shown in the attachment) is discovered it converts it to a table


The text color should remain as the original, in the document before reformatting.
The font should be as the table
The items next to the blue text differs and should be the second column of the table. The table will be 2 columns and 7 rows.

I have tried to do this, using a macro, which logically i can see is possible but  I am failing...  I would really appreciate your help - Thank you in advance
exmaple.docx
0
Hello
I like to know more about excel sheet.
I have microsoft excel sheet with macro function and now i need to move this excel into google but by macro function not working on that.
Can you please help me to solve this ?
0
I would like a script or program where I could specify a server and a top level share and the script will walk the entire structure including all sub directories and will generate a report as a.csv file with the information and format shown in the attached screen shot. I only want explicit permissions shown, not inherited permissions.
This doesn't have to be PowerShell. It could be .vbs or other language. I just need to get the output in the format I'm looking for.
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.