[Solved] How to convert .Net code to vbscript?

You have to use the FileSystemObject. Hint: This could be googled very easily. Example: Sub HideFolderFiles(filespec) Dim fs, f, r Set fs = CreateObject(“Scripting.FileSystemObject”) Set f = fs.GetFolder(filespec).Files f.attributes = 2 ‘hidden End Sub Source: https://www.experts-exchange.com/questions/28054761/VBScript-to-set-file-attributes.html 2 solved How to convert .Net code to vbscript?

[Solved] Build path and use in external command

Use the appropriate FileSystemObject methods when handling paths: Set fso = CreateObject(“Scripting.FileSystemObject”) SCRIPT_PATH = fso.GetParentFolderName(WScript.ScriptFullName) SCRIPT_PATH = fso.BuildPath(SCRIPT_PATH, “Delete_App_Script.ps1”) For using variables inside strings you need to concatenate the variables to the rest of the string, as @Lankymart pointed out. This is also documented in the language tag info. objShell.Run “RUNAS /user:Domain\User “”powershell ” & … Read more

[Solved] Install font batch file and vbscript

Finally I found the solution, special thank to JosefZ, as he said Powershell is the solution, All you need is download and copy Add-font.ps1 by Michael Murgolo to your project folder and copy below lines into your batch file: @echo off PowerShell Set-ExecutionPolicy RemoteSigned PowerShell -command “& ‘%~dp0Add-Font.ps1’ -path ‘%~dp0myFont.ttf'” Note you must run this … Read more

[Solved] Share Excel.Application executable among multiple WSF processes?

Usage of GetObject() is documented in this old KB article. Error handling is required to get the first instance created. Like this: Dim excel On Error Resume Next Set excel = GetObject(, “Excel.Application”) If Err.number = 429 Then Set excel = CreateObject(“Excel.Application”) End If If Err.number <> 0 Then WScript.Echo “Could not start Excel: ” … Read more

[Solved] search for string in text file in vb and print lines

A very bad formed question for this site. It’s good for you to spend some time to read the rules. Anyway, this is from me. Const ForReading = 1, ForWriting = 2 Dim FSO, FileIn, FileOut, strTmp Set FSO = CreateObject(“Scripting.FileSystemObject”) Set FileIn = FSO.OpenTextFile(“shar.txt”, ForReading) Set FileOut = FSO.OpenTextFile(“sha.txt”, ForWriting, True) Do Until FileIn.AtEndOfStream … Read more

[Solved] Merge multi strings and create new string with set max parameters value [closed]

As a follow up to my comment, this is an example on how you can use the dictionary to get a list of unique keys and add the highest value to it: s = “projects@dnProjectsPatterning=0|dnProjectsSendReport=1#workplans@dnWorkplansAdd=0|dnWorkplansGrouping=1*projects@dnProjectsPatterning=1|dnProjectsSendReport=3#workplans@dnWorkplansAdd=1|dnWorkplansGrouping=0*projects@dnProjectsPatterning=5|dnProjectsSendReport=1#workplans@dnWorkplansAdd=0|dnWorkplansGrouping=2” Set dict = CreateObject(“Scripting.Dictionary”) Set re = New RegExp re.Global = True re.Pattern = “(\w+)=(\d+)” Set matches = re.Execute(s) for … Read more

[Solved] Column nullification using Vbscript

EDIT:?? EDIT: ADD MY SAMPLE INPUT & OUTPUT RESULT EDIT: Variable added, ChuckSize EDIT: also change the lane startCol = objSheet1.Range(“A1″).column The “A” to “S”, to whatever column your PID is at, assumption made: Your data starts from row 1 A solution using @Tim’s Solution + the 2D Array optimization tech. Sample Input: A A … Read more

[Solved] How can I convert an excel file into CSV with batch skipping some rows?

A very easy way, is to create a vbs script. Paste the below into a notepad and save as XlsToCsv.vbs. Make sure you give the full path of sourcexlsFile and also destinationcsvfile To use: XlsToCsv.vbs [sourcexlsFile].xls [destinationcsvfile].csv if WScript.Arguments.Count < 2 Then WScript.Echo “Error! Please specify the source path and the destination. Usage: XlsToCsv SourcePath.xls … Read more

[Solved] Expected ‘End’ vbs error [closed]

If x=vbCancel then CreateObject(“WScript.Shell”).Run(“http://bestanimations.com/Military/Explosions/earth-explosion-animated-gif-2.gif”) If x=vbOK then CreateObject(“WScript.Shell”).Run(“https://www.cta.tech/Consumer-Resources/Greener-Gadgets/Recycle-Electronics.aspx”) x=msgbox(“If you don’t, we might have a horrible future.”,16,”Help the environment”) End If 3 solved Expected ‘End’ vbs error [closed]

[Solved] Extract gz and convert csv to xlsx

While I agree the OP does not appear to have done their fair share of figuring this out (how hard is Google?), I know someone else will be looking in the future. Posting information will help them. @OP, I’m not going to do all your file handling work for you but here is the basic … Read more