Scripting Languages

26K

Solutions

72

Articles & Videos

20K

Contributors

A scripting language is a programming language that supports scripts, programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled). Primitives are usually the elementary tasks or API calls, and the language allows them to be combined into more complex programs. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language.

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

Sign up to Post

Hi Experts,

Im new to powershell. I want to filter only to show Microsoft products installed in a machine and save it to a file. Below is the script Im writing. Is there anywhere i can fit where-object in it or any other suggestions.

Get-WmiObject -Class win32_Product -ComputerName $pc -Property name,vendor,version,installdate | ForEach-Object {
    '{0},{1},{2},{3},{4}' -f $env:COMPUTERNAME,$_.Name,$_.Vendor,$_.Version,$_.InstallDate
} | out-file C:\"$env:COMPUTERNAME"_SW01.txt

Open in new window

0
The Orion Papers
The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

I have linux server and i want to count pdf pages is colored or bw.

i have used imagemagic but it takes serverd down so can you help me with alternative way?
0
Hi

We use Windows 7 workstations and  antivirus product has been installed on 300 PCs on our network.

Now we have procured a new antivirus software and i would like to uninstall the old antivirus and install the new antivirus.When i try to install the new antivirus on the PCs, it fails and the error says , that the new AV cannot be installed until the old antivirus is uninstalled.
Please suggest if there is a way uninstalling the old antivirus.
Thanks and any help would be great.
0
Hey guys,

Am new to this community , I have a trouble over here while i am trying to delete the registry value.

Command:

reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders" /v "C:\Program Files (x86)\McAfee\VirusScan Enterprise\RepairCache\" /f

am getting the below Error when i execute the above command,

Error: The System was unable to find the specified registry key or value

But when i manually navigate to the registry value location and then when i try to delete it, i am able to delete it. Why its not working with the command?

Kindly help me with your answerserror message
0
Im using script to get the uptime of list of servers.. How to add 3 more columns to show Avg CPU, Memory utilization and C disk utilization using powershell


CLS
Write-Host "One moment please... Setting up..."


$ServerNameOption = "File"
$ServerNameFile = "C:\ttt.txt"
$BGColorColumn = "#BFC3C4"
$BGColorOnline = "#6DC046"
$BGColorOffline = "#D43235"
$BGColorReportTotal = "#4AA7E1"
$SendEmail = "True"
$ShowOnScreen = "False"
$ShowHTMLOnScreen = "False"
$ReportOutFile = "D:\test.html"

  
<#==============================
SMTP Settings
Edit with your email settings:
================================#>
$smtpsettings = @{
	To =  "receiver"
	From =  "Sender"
	Subject = "Server Report for $(Get-Date -Format D)"
	SmtpServer = "smtp"
	}

<#========
Counters
==========#>
$ServerCount = 0
$SuccessCount = 0
$UnreachableCount = 0


<#====================
HTML Report Settings
======================#>
$Report = "
	<html>
	<head>
		<title> ServerReport </title>
	</head>
	<body {background-color:#D7D8D8;}>
		<H1 Align=`"Center`"> <B>Report </B></H1>
		<H3 Align=`"Center`"> $(Get-Date -Format D) </H3>
		<H3 Align=`"Center`"> $(Get-Date -Format T) </H3>
		<table Border=`"1`" CellPadding=`"3`" Align=`"Center`">
			<tr>
				<td BGColor=$BGColorColumn Align=center><b> SERVER NAME </b></td>
				<td BGColor=$BGColorColumn Align=center><b> STATUS </b></td>
				<td BGColor=$BGColorColumn Align=center><b> UPTIME </b></td>
<td BGColor=$BGColorColumn Align=center><b> Avrg.CPU Utilization 

Open in new window

0
We have a script ( a batch file ) sett up on a computer that allows us to send mail from a command line to an email address.

My goal is to setup a webpage, so that from any computer I can go to this page, enter an email address, hit submit, and have the web server process the script and send out the email.

I know how to setup IIS on Windows server.  I can most likely figure out how to create a simple web page that accepts input.  

How do I pass along the input to the script and make it execute ?

Is there a ready made template that can be purchased ?
0
I am working with a number of large .csv files in Windows 7,  where I need to count the number of records and if possible iterate through the files and output the filename and record count of all the .csv files (in VBSCript or Windows Batch).    Any help is greatly appreciated. Thanks.
0
I'm looking how to run the commands to delete msol users and empty the recylce bin from a csv or txt list, the commands I have are:

Remove-MsolUser -UserPrincipalName users@domain.com -Force
Remove-MsolUser -UserPrincipalName users@domain.com -RemoveFromRecycleBin -F

Thank you
0
Hello Folks,
I'm trying to do an inventory for few PCs, I would need to run this command so I can output a CSV report
 Get-HotFix -id KB4012212

Open in new window


In case is not installed I would need to get this in the report as well..

I think for "for each will be in play"?
thanks for your awesome support

or if there another type of conversion to a differnt language such batch or vbs that be awesome too
0
I'm building a form to do a quick search for real estate listings. There is something wrong with the formatting with the very last set of 'select options' however and i can't figure it out. I use WordPress so i'm new to forms anyway. I do know that the city values and property type values are correct. MLS ids are correct.

It's got to be something simple i just can't fix it.
works.txt
breaks-the-site.txt
codes-put-together.txt
0
Containers and Docker for Everyone
Containers and Docker for Everyone

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

I have a python script that will construct a list of futures contracts for a specified symbol, exchange, and year window.  The script will download pricing information from Quandl for each contract in the strip.  This script works properly.

import pandas as pd
from pandas import ExcelWriter
import quandl

symbol = 'ES'
exchange = 'CME/'

start_year = 2015
end_year = 2016


#Constructs a list of futures contract codes for a particular symbol
#and timeframe.
futures = []
months = 'HMUZ'
for y in range(start_year, end_year+1):
    for m in months:
        futures.append("%s%s%s%s" % (exchange, symbol, m, y))

#Download the data from Quandl.
for f in futures:
    quandl.ApiConfig.api_key = "xxxx"  
    data = quandl.get(str(f))
    data = data.drop(data.columns[[3, 4, 7]], axis=1)

I have another python script that will create a continuous futures contract from 2 consecutive contracts in the futures strip.  It uses the perpetual method; identifying the roll date as the first day where volume of the far contract exceeds volume of near contract, and then adjusts the prices of the previous 4 sessions to roll date by weighting the near and far contracts in increments/decrements of 20%.  This script works properly.

import pandas as pd
from pandas import ExcelWriter
import quandl

#Get quandl futures data
quandl.ApiConfig.api_key = "xxxx"    
contract_near = quandl.get("CME/ESH2015")
contract_far = quandl.get("CME/ESM2015")

#Drop the columns …
0
Hello experts,

I am trying to call the ajax function only if there are values in 'stepname' and 'altmethod' else show and alert. When I include the following code, the else part gets executed all the time though there are no values. Could anyone kindly help me with this.

$(document).on("click", '#nextstep', function(e) {

    e.preventDefault();
 var stepname = $('#stepname').val(); 
 var chosen_altmethod = $('#chosen_altmethod').val();
 var altmethod = $('#altmethodname').val();

 
var formData = new FormData();
formData.append('stepname',stepname);
formData.append('altmethod',altmethod);
formData.append('chosen_altmethod',chosen_altmethod);
 formData.append('action','nextstep');

 console.log(stepname,"stepname");
console.log(altmethod, "altmethod");
console.log(chosen_altmethod,"chosen_altmethod");

if((stepname=="undefined") && (altmethodname=="undefined")){
  alert('please choose a step');
}else{
        $.ajax({
             type: 'POST',
            url: "<?= base_url() ?>index.php/variants/fetchstep1/",
             data: formData,
             processData: false,
      contentType: false,
             success: function (data) {

   $("#steplist").remove();
 $("#replacelist").html(data);
   $('html, body').animate({ scrollTop: 0 }, 0);
             }
         });
}
     });

Open in new window


Thank you in advance
0
We are migrating 100 users from Exchange 2010 to O365. I need to run a script that will export to CSV individual permissions there mau be assigned to user calendars, contacts, tasks or mailboxes. I do have a script that runs a high level permission report but not on the granular level to know that user X has read only access to user Y calendar or user A has full access to user B inbox

Thanks
1
Hello,
I have in a shell script, a variable that uses xmllint like this:

Xpath_querry = $ (xmllint --shell $ {xmlfile} << EOF
    Setrootns << EOF
    Xpath count (// defaultns: $ {parse_tag /} / defaultns: $ {tag}))

This worked but now, I have an EOF error in the console at run time.
Would anyone know another way to rewrite this variable (that the variable is used later in the script)?
0
Hi All,

When I tried to copy from one Removable USB HDD to another, it failed with the logs:

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows                              
-------------------------------------------------------------------------------

  Started : Monday, 12 June 2017 4:35:38 PM
   Source : F:\
     Dest : X:\

    Files : *.*
	    
  Options : *.* /DCOPY:DA /COPY:DAT /Z /J /MT:16 /R:1000000 /W:30 

------------------------------------------------------------------------------


------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         1         1         0         0         0
   Files :         0         0         0         0         0         0
   Bytes :         0         0         0         0         0         0
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00
   Ended : Monday, 12 June 2017 4:35:38 PM

Open in new window




This is my Robocopy command:
C:\>Robocopy F:\ X:\ /Z /J /mt:16 /LOG:"C:\Logs\F-X-COPY-log.txt"

 Log File : C:\Logs\F-X-COPY-log.txt

C:\>

Open in new window


Any help would be greatly appreciated.

Thanks,
0
Hi Experts,

I found this code to create a DSN and except of the login and password, everything else seems to work.
Wondering if someone can help me figure out how to do the SQL Authentication mode login/pwd?
     Dim vAttributes As String
        vAttributes = "DSN=MyDSNName" & Chr(0)
        vAttributes = vAttributes & "Description=Self Explnatory" & Chr(0)
        vAttributes = vAttributes & "Trusted_Connection=Yes" & Chr(0)
        vAttributes = vAttributes & "Server=MyServerName\Instance" & Chr(0)
        vAttributes = vAttributes & "Database=DBName" & Chr(0)
        Attributes = Attributes & "LoginID=UserName" & Chr(0) & "pwd=MyPWD" & Chr(0)

        SQLConfigDataSource 0&, 1, "SQL Server", vAttributes

Open in new window

0
Hello,

I was wondering if someone could help me with a macro or some script that would search through an excel File called 'Content' and there is another Excel file called URL, with two columns, A has old URL, and column B are what the old URLs should be replaced with.

The problem is that 'Content' has many worksheets with many data, and Excel B contains thousands of links that need to be replaced.

I've attached the excel files.

EDIT:
For example, if "http://www.hc-sc.gc.ca/dhp-mps/acces/drugs-drogues/index-eng.php" occurs anywhere in the Content workbook, it should be replaced with "https://www.canada.ca/en/health-canada/services/drugs-health-products/special-access/drugs.html"

If it could be done in VBA, great, if not, then any scripting language really.
URL.xlsx
Content.xlsx
0
Hi,
I need to find a way to generate a report via either tool or PS script for AD users with last logon date of greater than 30 days.

Any help is appreciated
0
I am able to launch a script from VBA and pass parameters to that script but I would like to be able to just active a particular function on an already running script from VBA as well as pass parameters to it.

Is this possible or am I limited to launching a script from VBA?

Thanks for the help!
0
Business Impact of IT Communications
Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

I am attaching the converted script. Please help me in updating the ?PROBLEM? parts in the entire script. Its quire urgent.

Thank you.
installapps90.py
0
I installed php 7.1.5. Does it come with fast cgi or do I need to install that myself ?

Thanks,

Michael
0
I currently login to the time from website using the following script.


browser = webdriver.Chrome('E:/Shared Folders/Users/runnerjp/chromedriver/chromedriver.exe')
browser.get("https://www.timeform.com/horse-racing/account/sign-in?returnUrl=%2Fhorse-racing%2F") 
time.sleep(3)
username = browser.find_element_by_id("EmailAddress")
password = browser.find_element_by_id("Password")
username.send_keys("usr")
password.send_keys("pass")
login_attempt = browser.find_element_by_xpath("//input[@type='submit']")
time.sleep(3)
login_attempt.submit()

Open in new window


it works but I find using Chrome web driver is hammering my CPU. Is there an alternative code I could use that does not mean I need to physically load the page to sign in?
0
I'm wanting to have a neat and tidy package for multiple images (preferably png, or jpg if I must) that are used in an AutoIt GUI.  I'll be sharing it uncompiled, and don't want the mess of a boatload of individual image files.
They will all be the same size (probably 512x512) that will be used at some smaller resolution.

I'm not aware of any way around an icon (.ico) file displaying only the different sizes.  (use freeware Real World Icon Editor & Photoshop is avail)
If the best way is to create a .dll then I'll learn.  Please give me a bit o guidance (ie visual studio and learn about it (here))
Are there other good approaches?

What is the best way to store a bunch of images?
0
Hi

 I have a shared drive on a windows 2012 server called " Shared"
 Within this drive , there is a folder called SCIENCE and within this folder there are sub folders.
 Initially I copied this folder from another server through Robocopy. Now I would like to delete this SCIENCE folder.

 When I delete I get and error that says Item Not found
 Could not find this item
 This is no longer located in E:\Shared. Verify the items location and try again.

 Please let me know how to delete this SCIENCE Folder. Is there a way of deleting this through Robocopy
 If so please post me the exact syntax and tutorials or if there is any other way.
 Thanks
0
I would like to get the output from this wmic query put into a variable

wmic printer where default=TRUE get name

Open in new window


Further, when this is run in a command prompt, the output is:

Name
\\PRINTSERVER\MyPrinter

I would like the variable to contain only the portion after \\PRINTSERVER\ which in this case will be simply MyPrinter.
0

Scripting Languages

26K

Solutions

72

Articles & Videos

20K

Contributors

A scripting language is a programming language that supports scripts, programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled). Primitives are usually the elementary tasks or API calls, and the language allows them to be combined into more complex programs. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language.