Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x

Scripting Languages

26K

Solutions

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 Expert
usually i issue these commands manually
i want script to issue in order to cover this task
can you write a simple script for me to cover this two steps

1- change the path of your working directory!!!!!
 cd c:\program files (x86)\Citrix\Licensing\LS

2- execute this command in order to delete all occupied licenses.
for /f "tokens=1,2" %i in ('udadmin -list ^| find /i "_ud"') do @udadmin -f %j -user %i -delete

3- exit and finish

thank you in advance
0
Quick Start: DOCKER
Quick Start: DOCKER

Sometimes you just need a Quick Start on a topic in order to begin using it.. this is just what you need to know to get up and running with Docker!

An in-house application developed in my University generates a .txt file containing time stops and values of HRV at that instance. The data from the application is being stored in the notepad each time the application is instructed to start measuring the HRV.  I am using MAX-MSP to play based on the HRV data. Which the best method to extract the data from the notepad file and calculate the average in real-time as each entry is made?
1
>Should contain only lower-case characters and numbers and the only special characters allowed are "_" and ".". So: ("[a-z0-9_.]")
> If there is no "." in the username, the script should ask for confirmation before creation of the user. The message should be:
"The username does not contain a dot, are you sure you want to continue?"
>Maximum amount of characters = 31
> Minimum amount of characters = 3
 and how to create user in specific CN [Built in OU] with Manuel entry?
0
Guys, can anyone provide install script to install the above mentioned HP audio driver using SCCM push
0
Hi,

I need a batch file script to execute from a citrix.  We need to publish 10 Websites in single page. User will select and click the website they want to use.  We used for Menu.hta and loading sites file into Menu. We are using Excel now for this but not looks good. can anyone provide script with other ideas to help me on this?
0
is this a php script?how to use it? is for creating a source.txt

<?php
$ips = $_POST['ips'];
$users = $_POST['users'];
function rand_string( $length ) {
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$size = strlen( $chars );
for( $i = 0; $i < $length; $i++ ) {
$str .= $chars[ rand( 0, $size - 1 ) ];
}
return $str;
}
$key = rand_string(8) . ".txt";
$fh = fopen($key, 'w') or die("can't open file");
$ips=explode("\n", $ips);
$users=explode("\n", $users);
foreach($ips as $ip){
foreach($users as $user){
$string= $ip.":".$user;
$string = preg_replace('/\s+/', '', $string);
fwrite($fh, $string);
fwrite($fh, " \r\n"); }}
$print = "Done! Poti sa descarci fisierul sursa si sa il adaugi in dubrute <a href=http://hiphopize.me" . $key . " >Click</a>";
echo $print;
?>

Open in new window


<html>
<head><title>RDP_SRCBuilder</title></head><center>
<body><form method="POST" action=create.php>Ips:<textarea id="ips" name="ips" cols="40" rows="15"></textarea>Users:<textarea id="users" name="users" cols="40" rows="15"></textarea><br><input type="submit" value="Show them all!"></center><br>
</body></html>

Open in new window

0
Is it possible within a script to run a elevated command and run a command with non elevated permission?
0
I should be able to do this but I think the brain has had enough for the day :~(


I have a file in the following format (already containing the values):

Server=\\servername\sharepath
Username=server\user
Password=passwdval

I need to read the values and insert those values into the following file (as shown below):


<SHARE>\\servername\sharepath</SHARE>
<DOMAIN>server</DOMAIN>
<USER>user</USER>
<UPWD>passwdval</UPWD>


This HAS to be done with a cmd file.
0
HI All,

I am trying to understand the code below, please can someone explain what is going on:

$ConfigData = @{
    AllNodes = @(
        @{
            NodeName = "*"
            PSDscAllowPlainTextPassword = $True
            PSDscAllowDomainUser = $true
           
        }
        @{
            NodeName = "DomainJoined"
        }
    )
}

Open in new window


Thank you in advance,
Kelly
1
Hi guys,
I need some help.
We are writing a little system that will catch mails sent from various monitoring systems and then pass them via API to Telegram (t save money on SMS plans)

Some of the mails are coming in a very easy to read format and they are already working. However mails sent from a certain system are giving me some trouble.

The way the system works is as such:
1) mail is received by postfix
2) mail is passed on to a script as stdin
3) mail is broken down to sender, subject and body via the script
4) script sends the generated values to the API and the people to whom it's relevant gets a message on Telegram.

All of the above is working well, unless I get a mail from a certain system that stumps the process.
After reading through the stream that's passed to the script, I figured out the problem is in the body.
I'm attaching part of the passed stdin with personal info removed

From: Someone
To: Someone else
Subject: test 3
Thread-Topic: test 3
Thread-Index: AQHTLGwuurwZ5el20EqN9dDhKU6/Vg==
Date: Wed, 13 Sep 2017 08:42:06 +0000
Message-ID: <0cb743aa4535462f8158bdba321abbd8@server>
Accept-Language: en-US, he-IL
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [213.8.94.213]
Content-Type: multipart/alternative;
      boundary="_000_0cb743aa4535462f8158bdba321abbd8MBX7gohostcoil_"
MIME-Version: 1.0
X-Originating-IP: 1.2.3.4
X-SpamExperts-Domain:
0
Free Tool: Port Scanner
LVL 10
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

<!DOCTYPE html>
<html>
<head>   
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />   
<title>Firebug</title>   

</head>   
<body>   
<div>   
  <h4>Talk to me:</h4>   
  <ul>   
    <li id="twitter" class="sprite"><a href="http://www.twitter.com">Twitter</a></li>   
    <li id="facebook" class="sprite"><a href="http://www.facebook.com">Facebook</a></li>   
    <li id="flickr" class="sprite"><a href="http://www.flickr.com">Flickr</a></li>   
    <li id="linkedin" class="sprite"><a href="http://www.linkedin.com">LinkedIn</a></li>   
  </ul>   
</div>   
   <script>
   var myAttrNode = document.getElementById("twitter").getAttributeNode("class");
   myAttrNode.nodeType;   // 11   
   myAttrNode.nodeName;   // "class"   
   myAttrNode.name;   // "class"
   myAttrNode; // "sprite"

//Array on Attribute Nodes, should output 2 for length.
var arrayOfAttrNodes = document.getElementById("twitter").attributes;   
arrayOfAttrNodes.length;   // 2
   </script>
</body>   
</html>

Open in new window


When I query the following (expected Firebug output in comments:)
myAttrNode.nodeType;   // 11  
myAttrNode.nodeName;   // "class"  
myAttrNode.name;   // "class"
arrayOfAttrNodes.length;   // 2

I get Undefined for all of them and no output. The only exception is "myAttrNode;" which correctly returns "sprite."

When I query:
arrayOfAttrNodes.id.value;
I get: ReferenceError: arrayOfAttrNodes is not defined.


Is this a browser compatibility issue or is my script missing something?
0
Hello EE,

I have the following script that I am running and it pulls up a command window, but I cannot get the command window to close.  I thought Exit would work, but it is not.  Neither is close.

@echo off
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
 /log="C:\Users\xxxxxxxxxxxxxxxx\Desktop\WinSCP.log" /ini=nul ^
  /command ^
    "open sftp://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/ -hostkey=""ssh-rsa 2048 9e:c2:dd:6d:86:a6:30:56:9d:ea:99:de:ff:c3:5f:2d"" -rawsettings FSProtocol=2 ProxyMethod=3 ProxyHost=""xxxxxxxxxxxxxxxxxxxxxx"" ProxyPort=xxxxxxxxxxx ProxyUsername=""xxxxxxxxxxxxxx"" ProxyPassword=""xxxxxxxxxxxxxxx""" ^
    "synchronize local T: /outbound/xxxxxxxxxx"
    "exit"

set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)

exit /b %WINSCP_RESULT%
0
Hi Experts,

Good Day..

As per my Work,  I have to move files from one sever to another server using  batch Script. I am able to perform this task. Screenshot of the same is attached below
move /y "\\ServerA\F$\Folder 1\*.zip" "\\ServerB\F$\Folder 3"

Open in new window


.But After this, I need to validate whether moving files is fine or not. If any error occurs (because of network issue or something ) , then need to perform moving task again..

SO how can I do this task ?  How can we capture errors? Can I use IF command ? Any help regarding this would be highly appreciated.

Thanks in Advance...
0
People,

Can anyone here please assist me in modifying the PowerShell script below to list all server and appliances that are still sending out email using the IP address of my physical Exchange Server 2013 (MBX-CAS role) except certain Exchange IP address list ?

For Example in the below Powershell, I wanted to exclude ClientIp: 10.1.1.125, 192.168.1.125 and 10.15.77.122 to not included in the CSV result.

Get-MessageTrackingLog -Server PRODMBXCAS-14-VM -resultsize unlimited -Start "12/08/2017 1:00:00 AM" -End "12/09/2017 11:59:00 PM" | where-object {$_.EventId -eq "RECEIVE"} | Select @{Name='Recipients';Expression={[string]::join(";", ($_.Recipients))}}, Sender, EventId, Timestamp, Source, MessageSubject | Export-CSV –Path "C:\Result\Dec2_Email_Statistics_Receive.csv" -NTI

Open in new window


How can I get that into the script above ?

After reading: https://technet.microsoft.com/en-us/library/bb124375%28v=exchg.150%29.aspx  What's the difference between:

Where {$_.OriginalClientIp -notlike "192.168.1.125"}
Where {$_.ClientIp -notlike '192.168.1.125'}
0
Hi,
I need help writing a batch file code that will run the first code, launch a program (.exe)  and than once program(.exe) exits run the second code.  
1st code
if exist C:\Windows\System32\nvapi64.Old goto Old
chdir /d C:\Windows\System32
ren nvapi64.dll nvapi64.Old
echo @ Named
pause

Open in new window


2nd code
chdir /d C:\Windows\System32
ren nvapi64.Old nvapi64.dll
echo @ Renamed
pause

Open in new window

0
I'm writing a batch file that needs to read In a text file with multiple lines (2-3 or more) and assign them to variables (i.e. Line1, Line2, Line3).  which will then act on those to run jobs based on the variables read in.  What is the easiest way to do this preferably without for loops or delims. etc.

Thx,
Brian
0
Hi People,

I’d like to request some PowerShell scripting help for testing document download and access that have been published by my users to the cloud service.

Steps to do:
1.      Loop through the month directory and then get all PDF published in that directory, then save it to C:\Test\Result\
2.      Go to the next month and then perform the same thing as above

URL:
January 2017
https://CompanyName.s3.amazonaws.com/Uploads/Finance/201701/20170101-USR-Report.pdf
https://CompanyName.s3.amazonaws.com/Uploads/Finance/201701/20170102-USR-Report.pdf 

https://CompanyName.s3.amazonaws.com/Uploads/Finance/201701/20170131-USR-Report.pdf 

Open in new window


 …

August 2017
https://CompanyName.s3.amazonaws.com/Uploads/Finance/201708/20170801-USR-Report.pdf 
https://CompanyName.s3.amazonaws.com/Uploads/Finance/201708/20170802-USR-Report.pdf  

https://CompanyName.s3.amazonaws.com/Uploads/Finance/201708/20170831-USR-Report.pdf 

Open in new window


I wanted to test if the user published the document as per the standard naming convention or not.

Any help would be greatly appreciated.

Thanks,
0
var clone = function (donor) {   
  if (Object.create !== undefined) {   
    clone = function (donor) {   
      return Object.create(donor);   
    };   
  } else {   
    clone = function (donor) {   
      var Proxy = function () {};   
      Proxy.prototype = donor;   
      return new Proxy();   
    };   
  }   
  return clone(donor);   
};   
var banana = {   
  heavyCream: [1, "cup", "Organic Valley"],   
  halfHalf: [1, "cup", "Organic Valley"],   
  sugar: [9/16, "cup"],   
  yolks: [3],   
  banana: [1 + 1/2, "cup, puréed"],   
  coconutMilk: [1/4, "cup"],   
  lemon: [2, "tsp", "freshly juiced Meyer lemon"],   
  vanilla: [1, "bean", "Madagascar Bourbon"]   
};   
var chunkyMonkey = clone(banana);   
chunkyMonkey.walnuts = [3/4, "cup, coarsely chopped"];   
chunkyMonkey.bittersweet = [1, "cup, coarsely grated", "Callebaut"];   
console.dir(banana);   
console.dir(chunkyMonkey);

Open in new window


Could someone walk me through what this code does? Is this code block considered "Lazy Loading?"  I believe the code redefines the clone() function and then uses clone() to copy the Banana Object (and it's properties) into a new ice cream flavor called 'chunkyMonkey'.  I understand the end result, but don't understand the functions themselves.

Isn't Object.create() a native function? If so, why is it Undefined?
What is the .prototype property for Proxy doing? Why is Proxy.prototype being passed into the clone function?
0
I need a powershell script that will ping a dns name and if it replies, set a registry value in HKEY_CURRENT_USER to 1 and if its not pingable set the registry value to 0.

I appreciate the help with this?
0
Cloud Training Guides
Cloud Training Guides

FREE GUIDES: In-depth and hand-crafted Linux, AWS, OpenStack, DevOps, Azure, and Cloud training guides created by Linux Academy instructors and the community.

I need a python(2.7) coder to help me with this script:  https://pastebin.com/zYLbFwpi  (rdpy-rdpscreenshot.py)
Original site: https://github.com/citronneur/rdpy 
Now i run this .bat: https://pastebin.com/SYHy0EsB  ,everything goes well but the problem is that it stops at line 2 trying and re-trying  to connect endlessly without going to the 3rd line (maybe NLA is activated),anyway all i want is to close & exit and pass to the 3rd line.
THANK YOU!

P.S.
- here a succesull line: https://pastebin.com/XqWpn3RU
- here problem line: https://pastebin.com/daRqSV0Y

i used a small tool to compare the 2 files and the diference is this:
rdpy.core.error.RDPSecurityNegoFail: negotiation failure code 5
[*] INFO:       save screenshot into C:/tmp/24.73.34.125.jpg

Open in new window

0
powershell script which finds total uptime in last 24 hours for many servers
0
Hi Experts,

As part of an imaging process using a third party utility I am able to create a computer name and login as local admin. I need to run a batch script which will add the machine to the domain using this new computer name. Can someone provide examples that have worked for them?

Thanks
0
Hi Experts, I need to add a delay within a batch file so that it starts after 2 minutes. This batch script runs as part of first login when imaging machines and I call the batch file by specifying this command within software we are using to image machines. The OS is Windows 10 Enterprise:

C:\Apps\AnyConnect\Regimport.bat

The first part of script calls an elevated prompt, the next part after ECHO runs the actual command

::::::::::::::::::::::::::::::::::::::::::::
:: Automatically check & get admin rights V2
::::::::::::::::::::::::::::::::::::::::::::
@echo off
CLS
ECHO.
ECHO =============================
ECHO Running Admin shell
ECHO =============================

:init
setlocal DisableDelayedExpansion
set "batchPath=%~0"
for %%k in (%0) do set batchName=%%~nk
set "vbsGetPrivileges=%temp%\OEgetPriv_%batchName%.vbs"
setlocal EnableDelayedExpansion

:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )

:getPrivileges
if '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges)
ECHO.
ECHO **************************************
ECHO Invoking UAC for Privilege Escalation
ECHO **************************************

ECHO Set UAC = CreateObject^("Shell.Application"^) > "%vbsGetPrivileges%"
ECHO args = "ELEV " >> "%vbsGetPrivileges%"
ECHO For Each strArg in WScript.Arguments >> "%vbsGetPrivileges%"
ECHO args = args ^& strArg ^& " "  >> "%vbsGetPrivileges%"
ECHO …
0
Hi guys,
I have to rename a bulk of shared mailboxes to a new format, the script is ready and works but when the script runs, the names that contains accentuation are not being updated properly and a question mark is shown where the accentuation should exist.


-----------------------------------------input file:
name,NewName
BMS-cipatubarao,"CIPA Tubarão"
BEL-liberacaeodelimbo-amd,"Liberação AMD"

-----------------------------------------Script:
$sharedChange = Import-Csv .\"SHAREDchange.csv"
$sharedChange | foreach{
      $sharedName = $_.name
      $sharedNewName = $_.newname
      try {
      # Change the DisplayName on Services Domain
            set-user $sharedname -displayname $sharedNewName
            "$(get-date -f MM/dd/yyyy-HH:mm:ss), $sharednewname, modified on, $sharedname`n" | out-file '.\SharedSuccess.txt' -append
      }      catch {
            "$(get-date -f MM/dd/yyyy-HH:mm:ss), $sharednewname, NOT modified on, $sharedname`n" | out-file '.\SharedFailed.txt' -append
      }
}
-----------------------------------------output file:
09/04/2017-17:47:12, CIPA Tubar�o, modified on, cipatubarao
09/04/2017-17:47:14, Libera��o AMD, modified on, liberacaeo-amd

What should I do?
I have already tried to use the command directly on my shell using set-mailbox liberacaeo-amd -displayname "Liberação AMD" and it works, but as I have a batch of shared mailboxes to execute this change, this is completely out of  question.
0
Please provide me with the correct syntax for granting a user full access to another user's Office 365 calendar by using the Office 365 Power Shell.

For example this command grants a single user full access to everyone's calendar within Office 365.

How can this power shell command be modified to grant a single user access to another user's Office 365 calendar?

Get-Mailbox | ForEach-Object {Add-MailboxFolderPermission $_":\Calendar" -User msmith@company.com -AccessRights Owner}

Open in new window

0

Scripting Languages

26K

Solutions

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.