Still celebrating 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 Experts,

Good Day,,,

According to my work, I need to ftp files from one server to another using batchscript.I am able to do the same.
logs are getting saved into outputlog.txt file which is present in the same server path.

My requirement is ,need to send a mail with attaching outputlog.txt .
If it is successful (means errorlevel=0 ) then subject should be ftp successfully completed.And if it get failed,then subject should be ftp failed.In both the cases, log file should get attached.

Any help regarding this would be highly appreciated.
Thanks in Advance..
0
Use Filtering Commands to Process Files in Linux
Use Filtering Commands to Process Files in Linux

Learn how to manipulate data with the help of various filtering commands such as `cat`, `fmt`, `pr`, and others in Linux.

Hello,

I have a powershell script which essentially "works" but with one caveat.

This script queues all the mailboxes to export immediately (i.e. if my text file contains a list of 15 mailboxes then the script queues all 15 mailboxes to export immediately).

The problem I have found is that when the server is trying to export more than one mailbox concurrently, some of the mailbox exports fail.

So I would like a way to either:

1. Modify the script to only perform one export at a time or
2. Configure some setting in Exchange so that only one New-MailboxExportRequest is executed at a time (I've had a look at the settings for this cmdlet and cannot see an option to do this)

$Export = Get-Content C:\Mailboxes.txt
foreach ($i in ($Export)) {New-MailboxExportRequest -ContentFilter {(Received -lt '01/09/2017')} -BadItemLimit 200 -AcceptLargeDataLoss -Mailbox $i -Filepath "\\SERVER\Mail\$($i).pst" }

Open in new window


Thank you
0
Hello,
We use the below code in a batch file in our Windows environment to allow the logged in user to backup their own data to a network drive.  It works great for computers that primarily have one user, but we have 100's of computers that have several users who share the same computer.  

How can the same code be used to allow an administrator to login and run the bat file to backup the same same profile data BUT for ALL profiles that have been modified in the last 90 days?

@echo off

REM variables
set drive=\\SERVER01\UserBackUps\BackUpJobs\%USERNAME%
set backrestorecmd=robocopy.exe /s /COPY:DAT /r:1 /w:1 /np /xo

echo **********Closing Outlook**********
timeout /t 5 /nobreak
taskkill /f /t /im outlook.exe

echo **********Backing up DOCUMENTS**********
%backrestorecmd% "%USERPROFILE%\Documents" "%drive%\Documents"

echo **********Backing up DESKTOP**********
%backrestorecmd% "%USERPROFILE%\Desktop" "%drive%\Desktop"

echo **********Backing up FAVORITES**********
%backrestorecmd% "%USERPROFILE%\Favorites" "%drive%\Favorites"

echo **********Backing up PICTURES**********
%backrestorecmd% "%USERPROFILE%\Pictures" "%drive%\Pictures"

echo **********Backing up VIDEOS**********
%backrestorecmd% "%USERPROFILE%\Videos" "%drive%\Videos"

echo **********Backing up MUSIC**********
%backrestorecmd% "%USERPROFILE%\Music" "%drive%\Music"

echo **********Backing up Outlook settings**********
%backrestorecmd% "%USERPROFILE%\AppData\Local\Microsoft\Outlook" 

Open in new window

0
hello,

i need to delete some folder on server (windows 2008 or 2012).
but some times process blocked some folder or file to be deleted.

i need a script or command to check if any process is use specific folder and kill them so i can delete the folder.

i need a script because i have many folder to delete every day.

thanks for help
0
Hi
I want to delete old user profiles from machines automatically and leave the local "administrator" and the current user profile intact, or if it can be done by date any profiles older than 30 days get deleted..

how can this be achieved, script or GP?

Thanks in advance!
0
People,

Can anyone here please assist me in why the below VBScript to set email signature is not working for Outlook 2016 and above ?

'========================== 
' ############### Script that creates a standard company signature for all users (in a corporate environment); pulling data from Active Directory - dynamic logo insertion depending on department field if needed. 
' 
' Original by Severn Dickinson 
'
' Big up to Script Centre 
' 
' 14-10-2016. 
' 
'=========================== 
  
On Error Resume Next 
Set objSysInfo = CreateObject("ADSystemInfo") 

' ########### This section connects to Active Directory as the currently logged on user 
 
strUser = objSysInfo.UserName 
Set objUser = GetObject("LDAP://" & strUser)  
 
 
' ########### This section sets up the variables we want to call in the script (items on the left; whereas the items on the right are the active directory database field names) - ie strVariablename = objuser.ad.databasename 
 
strGiven = objuser.givenName 
strSurname = objuser.sn 
strAddress1 = objUser.streetaddress 
strAddress1EXT = objUser.postofficebox 
strAddress2 = objuser.l 
strAddress3 = objuser.st 
strPostcode = objuser.postalcode 
strCountry = objuser.c 
strFax = objuser.facsimileTelephoneNumber 
strMobile = objuser.mobile 
strTitle = objUser.Title 
strDepartment = objUser.Department 
strCompany = objUser.Company 
strPhone = objUser.telephoneNumber 
strEmail =objuser.mail 
strWeb = "MyCompany.com" 
strNotes = objuser.info 
strExt = 

Open in new window

0
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
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
On Demand Webinar - Networking for the Cloud Era
LVL 10
On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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 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
<!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
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
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
Certified OpenStack Administrator Course
Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

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
Morning all,

I hope this is not too trivial for you so early in the morning.

I need a powershell script to run against a list of machines, (preferably against AD) and out put to CSV with Machine name, Mapped Drive and last user who logged on.

So far I have this:

Get-WmiObject -Class Win32_MappedLogicalDisk -ComputerName <Computer Name> | select Name, ProviderName | Out-File C:\Temp|Mapped.csv

I used this to query my own machine which came back with parts of the info I require, but as I want to target it against AD or a list of computernames I want it to output Machine name and last logged on user.

Thanks
0
1.      I want to import a CSV file
2.      Add a column to the data - Just the filename
3.      export into a new file.

$MyCSV = import-csv .\ReportDetails.csv
$MyCSV | export-csv .\ReportWithProcessedDate.csv –NoTypeInformation

So how can I add a new column "#2"  before I export the data to a new csv file?
0
I'm trying to export by OU with all groups and members name but would also like to get the user displayname.
what is correct line to use get-adgroup and get-aduser with displyname ?


this is my example without get-ADuser

$AdmnGrps = foreach ($group in (Get-ADGroup -Filter * -SearchBase "OU")) {Get-ADGroupMember $group | Select @{Label="Group";Expression={$Group.Name}},@{Label="User";Expression={$_.Name}}} $AdmnGrps | Sort Group,User | Export-Csv AdminGroups2.csv
0
HI,

I have an ERP and its use windows local users authentication and i need a script to prompt users to change their password when password soon to expire as i configure on local security policy.
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.