Click here to Skip to main content
15,885,985 members
Everything / Script

Script

script

Great Reads

by Simon P Stevens
How to set the current directory correctly when running batch scripts as administrator
by Sujeet Bhujbal
In this article, I will tell you how to create a cross-browser session expiration popup box using jQuery easily
by Jack Devey
This post delves into the perplexing Monty Hall paradox, examining the probabilities associated with sticking or switching doors in the game scenario.
by Er. Puneet Goel
This tip implements the TreeView like DropDownList with Search Functionality using Telerik Kendo.

Latest Articles

by Wessel Beulink
Azure spearheads cloud evolution, Azure Automation Runbooks manage hybrid/SOC environments effectively
by Federico Di Marco
Create quickly VPN connections in Windows according to a XML configuration file
by Jack Devey
This post delves into the perplexing Monty Hall paradox, examining the probabilities associated with sticking or switching doors in the game scenario.
by ToughDev
How to identify used and unused resources in VS Project Resources.resx file

All Articles

Sort by Score

Script 

20 Oct 2010 by Simon P Stevens
How to set the current directory correctly when running batch scripts as administrator
10 Mar 2017 by Sujeet Bhujbal
 In this article, I will tell you how to create a cross-browser session expiration popup box using jQuery easily
13 Jun 2023 by Jack Devey
This post delves into the perplexing Monty Hall paradox, examining the probabilities associated with sticking or switching doors in the game scenario.
7 Mar 2011 by Orcun Iyigun
SO here is what you need to do;You can do it one row at a time in to the database.Mainly this method is just opening a connection to the access db, going through each row in the gridview datasource (if you create the datasource on the fly you might need to recreate the table at the...
9 Jan 2015 by Er. Puneet Goel
This tip implements the TreeView like DropDownList with Search Functionality using Telerik Kendo.
16 Mar 2015 by Sander Rossel
The sixth in a series on web development.
9 Mar 2015 by Gregory Morse
Rendering Qur'anic (complex Arabic) scripts with Unicode in a PDF
30 Nov 2011 by #realJSOP
You can't protect SWF files. Once they've been served to the machine, they can be modified, erased, or moved/copied. Believe me - I dealt with this for a year.
8 Jul 2012 by OriginalGriff
No. The only way to find out is to send an email to the address and see if you get a response.That is why so many systems send a registration completion message, which requires the user to follow a link to complete registration - it confirms that at the time of sending the email address was...
25 Mar 2013 by jkirkerx
Basically a slideshow script, but more simple in design and easier to deploy.
27 Dec 2012 by Zoltán Zörgő
In general you can not - and you should not.First of all, it is windows-only, and more or less IE-only.This was a feature mostly in IE (se example here: http://www.rgagnon.com/jsdetails/js-0111.html[^]), but it was disabled by default, because it is a huge security risk.Consult this...
25 Mar 2014 by chaau
reg is a Command Prompt command. When you call reg add you are supposed to call it from cmd. Therefore, the easiest solution for you is to put your code to a file with and extension of .bat or .cmd. Create an empty file with .bat or .cmd extension and copy and paste your command there:reg...
4 Jun 2017 by petrostherock
Making your apps script URLs a lot more attractive
16 Jun 2020 by Richard MacCutchan
You need to use the set and for commands to get and parse the values. The following example merely echoes them back to the console, but should give you the idea. set /P choice=What are your choices? echo %choices% for %%i in (%choices%) do echo...
3 Jan 2023 by Han Bo Sun
Several ways of form field validation using Angular framework
6 Mar 2023 by V. Subhash
This final part of the article series covers some other important behaviour of bash, particularly that relating to text expansions and substitutions.
26 Jun 2011 by SCraw2855
Greetings all,First of all, let me apologize for newbingly not knowing where to address this question properly, as I'm somewhat "green" behind the ears when it comes to coding. I have a feeling that the answer to my question is very easy, but I'm tired of fighting it. A friend gave me a few...
10 Oct 2011 by Richard MacCutchan
My suggestion would be to add a Auto_open VBA macro which offers the copyright notice as a dialog. The user then has the choice to click on Accept or Reject, and if not Accept the macro automatically closes the worksheet. Of course, this is not foolproof, but it is at least good enough to make...
13 Oct 2011 by DaveAuld
Seeing as you are already using JQuery, why not use the autocmplete plugin;http://docs.jquery.com/Plugins/autocomplete[^]could save you some t+e.
4 Jun 2012 by VJ Reddy
The Danish month names can be obtained as an array of strings as follows:string[] monthNames = System.Globalization.CultureInfo.GetCultureInfo("da-DK").DateTimeFormat.MonthNames;//monthNames...
9 Jun 2012 by abhinavvijay
you can see below linkGoogle Maps in HTML, ASP.NET, PHP, JSP etc. with ease[^]
7 Apr 2014 by Dev Leader
IronPython: A quick WinForms introduction
12 Jun 2014 by Jani Mäkinen
Program return values inspected by .bat files with visual feedback
26 Aug 2014 by Zoltán Zörgő
Sure. Many of us can create such thing. But none will. Let's see why:0) There is no such thing as "java script", just Javascript — which has little to do with java.1) You can't make any GUI just with Javascript. Even if you don't add any static HTML markrup to your page, you still need...
7 Oct 2014 by Sergey Alexandrovich Kryukov
This application should not be in C:. Do you know that a system does not even have to have drive C?!And this is not a "DOS command". In modern OS, there is no such thing.Simply use System.Diagnostics.Process.Start with redirection of...
7 Oct 2014 by Maciej Los
Why to torture yourself by sending some command to the 'command prompt'?Isn't better to use .net classes, objects?Please, see:Network Programming in the .NET Framework[^]NetworkInterface Class[^]Quite often used alternative is WMI[^], which provides functionality to get information...
19 Dec 2015 by dineshiam
This tip will give an overview to Sitecore developer about how to migrate data using Sitecore PowerShell scripts.
12 Jan 2016 by Garth J Lancaster
First off ... ".vbs (text .txt)" - thats expressed a bit 'awkwardly' - You're learning VBScript, its representation is 'text', and (by convention) an extension of '.vbs' on a file means it can be executed by the Windows Script Host - you could put your script into a file with a ".txt" extension...
22 Feb 2016 by Sifiso W Ndlovu
This tip illustrates a workaround to SQL Server pivoting on variable character data types.
11 Oct 2018 by Richard MacCutchan
if "%count_slu%" EQU 0 ( Echo get out >> C:\SLU\Netsol_SLU_File_Delay\Net_Account_Log_%dt%.txt) Remove the double quotes around "%count_slu%", or add double quotes round the 0. You are trying to compare "0" with 0.
28 Feb 2020 by Patrice T
Even if I don't practice SQL, I have enough experience to see a very bad design, something to avoid at all cost. - Because you use current_datetime() 2 times, you can be unfortunate and have them on a different minute, hour or day which will...
29 May 2020 by OriginalGriff
Start of by learning C# first - ignore Unity until you have the basics done and properly sorted in your head. A course is the best idea - check locally, you may find evening classes - or a book if that isn't available (Wrox, Addison Wesley, and...
8 May 2023 by ToughDev
How to identify used and unused resources in VS Project Resources.resx file
N 14 Apr 2024 by Pete O'Hanlon
This is the type of question that you could probably get answered using something like ChatGPT or Google Gemini. You have the information you want in your question, so what you need to do is write a prompt that will give you a suitable answer....
7 Dec 2010 by E.F. Nijboer
try rows[i] instead of rows(i).Good luck!
21 Dec 2010 by JF2015
You could easily google "html to pdf".One commercial solution I found was:http://www.winnovative-software.com/[^]
25 Jan 2011 by Sergey Alexandrovich Kryukov
Did you notice: this is not a valid address: "1:1:2:1"?
6 Mar 2011 by Sunasara Imdadhusen
Hi,Why you want to create INSERT script for each record? you can use BULK INSERT for single call of DataBase.See the following ExampleBULKINSERT CSVTestFROM 'c:\csvtest.txt'WITH(FIELDTERMINATOR = ',',ROWTERMINATOR = '\n')GOThanks,Imdadhusen
6 Mar 2011 by That's Aragon
Hi,This might help you.http://msdn.microsoft.com/en-us/library/ex21zs8x.aspx[^]
6 Mar 2011 by sunder.tinwar
I had same required a month before. I think for your requirement solution 1 fits best. Because you dont have and reference in these records.But if you have reference in records then you can use this logic.First divide whole file to record seperator. ie \n herethen for each array index...
7 Mar 2011 by AspDotNetDev
You can use C# (or VB.net) to load up the page using the WebClient class. You can then search the string for "1000" and "1,000". Then you can send out an email using the SmtpClient class. Unless somebody knows of an existing tool that does this, you'll have to build it yourself.
7 Mar 2011 by sunder.tinwar
If you fetched all records into datatable the directly pass this datatable into a stored procedure and from stored procedure insert all rows into one shot by insert select query.Please let me know if you want this solution.Remeber this works only in sql server 2008 onwards.butIf...
9 Mar 2011 by pankajupadhyay29
check these links and you can find many more in google search.ASP.NET Popup Control[^]AjaxToolkit Popup[^]--Pankaj
9 Mar 2011 by Sandeep Mewara
Have a look at these:ASP.NET Popup Control[^]ModalPopup Demonstration[^]If need for more, look here[^]
9 Mar 2011 by Sergey Alexandrovich Kryukov
A word of warning for you. As pop-ups are irritating and ofter carry unwelcome advertisement, many users block them using their Browsers' popup-blocking features or plug-in.A good alternative is using hidden element (usually div). You control its visibility and focus on some input element in...
28 Mar 2011 by perry.p
Hi,I want to restrict IDM or any such video downloader software to download videos from my site. Site is use to play streamed videos (Live as well as prerecorded).The problem is that when I play video IDM start showing the download option to download the video.How can I prevent...
4 Apr 2011 by WebMaster
Hi,I want to save the body content of a email in outlook to a local file. I am able to save the entire message .msg but i want to save only the html content of the body. for example: In the outlook email body i have a table i want to save that table to a file. the script which i am working...
4 Apr 2011 by dbrenth
You may want to look into[Microsoft Exchange Web Services]It's much more robust than the outlook interop.Good Luck
4 Apr 2011 by Wendelius
Perhaps I misunderstood your question, but when you open the mailitem, why don't you just get the data from the HTMLBody property and write that to a file for example using TextWriter class. If you use Outlook to save the message, it'll save also parts of the header etc.
12 Jul 2011 by RaisKazi
You can do this by Ajax. Add reference of “jquery-1.4.1.min.js” or ”jquery-1.5.1.min.js” in your .aspx page. In below code Javascript function "JqueryAjaxExample" will call Page Load Of Page2.aspx. Javascript function "JqueryAjaxExampleResponse" will invoke when response will come...
12 Oct 2011 by Nagy Vilmos
Have you looked here - http://www.obout.com/em/KnowledgeBase.aspx[^][posted at DM's behest]
9 Jan 2012 by Sarvesh Kumar Gupta
Hi use below:btnSave.attributes.add("onclick","javascript:return deteterecord();");Write this at page load in !ispostback. please check.
26 Jan 2012 by R. Giskard Reventlov
Free points! Is there a question you want us to answer or would you be better posting this as an observation in the lounge or a personal blog post?
21 Feb 2012 by spores
Hi Folks,I'm trying to figure out how to script something that will go through a directory and reset the sychronization bit on a file. Looking at the fsecurity output below I need Sychonrize=1. Frankly I am not a windows programmer and am not sure how the subroutine should look. I would...
27 Feb 2012 by Bernhard Hiller
Get the longutide and latitude coordinates from your database, and the zoom level. Place those data into their respective positions of the URL.
2 May 2012 by Eugene Polyhaev
Fully functional groovy template scriptlets inside a docx document
19 May 2012 by Espen Harlinn
Have a look at Warping 3D Text[^]Does what you need and then some ...Best regardsEspen Harlinn
15 Jun 2012 by db7uk
if the error is referring to valid xml mark-up then try using "& lt;" (without spaces) instead of "
25 Jun 2012 by Prasad_Kulkarni
Have a look for reference:Obtaining Data from a Remote Computer[^]
9 Jul 2012 by Manas Bhardwaj
NO language supports this kind of validation and IMHO it never should.
12 Jul 2012 by Prasad_Kulkarni
Classic ASP Locale and Localization Sample[^]Localization in Classic ASP[^]
29 Jul 2012 by Christian Graus
Here[^] are lots of articles on how to read XML in flash. Note that an article will be more in depth than a forum reply and of more use to a beginner like yourself.
5 Nov 2012 by kangkiyong
// Is a simply way..//Common.Response.Write("alert('Successfully Updated')"); string url = "Quick.aspx"; string cmd = "alert('Successfully Updated');window.open('" + url + "', '_blank',...
27 Dec 2012 by Rai Pawan
Simply not possible :)Had this feature been there in javascript, everyone would turn in to a modern day hacker.RegardsPawan
9 Jan 2013 by vinu2528
Hello Everyone I am searching for any code/scripting to zoom a div while clicking on div.I have a condition that while zooming the div the contents(images,text) of the div also gets zoom.....If anyone know how to do this then please helpthanks in advance
16 Feb 2013 by S. M. Ahasan Habib
first write a class which will execute script as followspublic class ScriptExecutor{ public static void ExecuteScript(string connectionString, string directory) { string[] files = Directory.GetFiles(directory, "*.sql", SearchOption.AllDirectories); try ...
19 Feb 2013 by Zoltán Zörgő
If you have Windows 8 (not RT), you can install SQL Management Studio 2010 and 2012. Those also have "Script Database" function.But you can write your own application to do scripting. See following articles - all using...
24 Feb 2013 by Orcun Iyigun
I think this is what you are looking for;Check username availability from database[^]-or-Better link : http://bit.ly/ZDo9Pj[^] :) Good luck,OI
7 Jun 2013 by SoMad
It will depend on which country you live in. You profile says USA, but since you just signed up today, you might not have that set correctly yet.Anyway, here is a link to a CodeProject article in VB.NET that handles this very issue for holidays in the US.Holidays and business date...
13 Jun 2013 by OriginalGriff
You missed a comma:SELECT cat_validation.name, cat_validation.description, cas_user_ext.email cat_validation.primarypin FROM BecomesSELECT cat_validation.name, cat_validation.description, cas_user_ext.email, cat_validation.primarypin FROM
12 Aug 2013 by macmacmacmac
instead of ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Fill all the necessary information.');", true);try this: Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "Alert", "alert('Fill all the necessary information.')", true);or debug your control...
3 Oct 2013 by Bhagavan Raju M
var Pname = document.getElementById('').value; if (Pname == " " ) { alert("Please Enter Date."); return false; } var vechileno = document.getElementById('').value; ...
8 Oct 2013 by OriginalGriff
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.Try it yourself, you may find it...
11 Oct 2013 by ASP.NET Community
Following script will move the selected items from one list box item to another list box item.Markup:
11 Oct 2013 by ASP.NET Community
suppose your url ishttp://www.xyz.com/defaultand some hacker try for hacking the website so type some script text on url
15 Oct 2013 by Prasad Khandekar
Hello Murthy,This is a known problem in showModalDialog. See following links. IE 8 KB974455 causing an error with VBScript window.returnvalue[^]If you really want to return an array and access it I suggest you clone it as shown below or use a string as return value.// In the...
13 Jan 2014 by ErBhati
try this ScriptManager.RegisterStartupScript(this,this.GetType(),"name", "alert('Successfully Updated');", true);select as answer if it works for u.
18 Mar 2014 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
JavaScript is a Scripting Language, by which you can communicate with user and browser at the client side.The libraries you mentioned in your answer are actually having JavaScript codes, which does complex operations, but provides us a simple method.Suppose you would like to find all...
18 Mar 2014 by Peter Leow
About the javascript libraries, refer: js_libraries.asp[^]. Basically, these libraries exist to help us "write less do more".To learn javascript, you may start with this JavaScript Tutorial[^]
17 Feb 2015 by Thomas Daniels
Use the following JavaScript code. Wrap it in a tag and place it on your tag:window.onload = function () { var txt = document.getElementById(""); var btn = document.getElementById(""); if (txt.value === "") { ...
16 May 2015 by OriginalGriff
Connect to your SQL Server in the usual way, using a user id/password combo that has permission to create databases.Then run your DB script as a command string, exactly as if it was a normal ExecuteNonQuery command (which it is).You can get the script from an existing DB using SSMS, by right...
16 May 2015 by virusstorm
This is what the code would look like to OriginalGriff's solution. I wrote this a couple months ago to do basically what you are doing. It is designed to handle scripts that have the GO statement.using System;using System.Collections.Generic;using System.Data.SqlClient;using...
17 May 2015 by Sascha Lefèvre
Yes, it can be written in a bit more elegant way - provided that there's no use for the case that value1 and value3 are set but not value2:if(isset($_POST['submit'])){ if(!empty($_POST['value1'])) { if($_POST['value2']) { if($_POST['value3']) { // do...
5 Jul 2015 by Afzaal Ahmad Zeeshan
Because that is not how if...else block works. An if else block (with complex expressions) requires you to use AND operator (which you are) along with different expressions or variable or statements that resolve to boolean value (true or false). Your code does not follow the guidelines. I...
22 Jul 2015 by Sergey Alexandrovich Kryukov
If you target Windows, one set of tools would be the Windows remote administration service (which should work on target computers anyway) and PowerShell.Please see: https://4sysops.com/archives/change-the-local-administrator-password-on-multiple-computers-with-powershell[^].In principle,...
26 Aug 2015 by Richard Deeming
For robocopy, both the source and destination must be directories. You are passing the path to a file, and robocopy is correctly telling you that it's not a directory.To transfer specific files, use robocopy source_dir destination_dir file. For example:robocopy...
26 Nov 2015 by PANKAJMAURYA
The Bash/KSH and POSIX shell provides a file redirection option to redirect the output of commands to a file using the following two operators:1. > is output redirection symbol.2. >> is append output redirection symbol.So Your command would be $PS -e > /root/output.txtPlease...
9 Dec 2015 by OriginalGriff
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.Try it yourself, you may find it...
22 Mar 2016 by Jochen Arndt
Usinggcc -Wall -c menu.cthe error shown in your question does not occur. But there are some other errors and warnings. Most of them can be avoided by including additional header files:# include # include # include # include # include...
3 Jul 2016 by Passion4Code
Hello,Please check the link below:Validating Start/End dates in AngularJS[^]Else post the code snippet you have tried to implement.Thanks
20 Nov 2016 by anup.bhunia
In ASP.NET MVC retaining data is very simple;if you POST a form where controller found some error and revert back the view with input module bound with it, so no worry.If you do a custom Ajax post, HTML would not be changed, you need to show the Action result on top of the earlier HTML,...
8 Feb 2017 by Jochen Arndt
That is because that function is deprecated and has been removed for recent browsers. See Window.showModalDialog() - Web APIs | MDN[^].For alternatives read the "See Also" section at the above link and search for "javascript showmodaldialog replacement" or "javascript showmodaldialog...
1 Jun 2017 by Leo Chapiro
WScript.exe is not a compiler but an interpreter because VBScript is not a compiled programming language but a script language. This interpreter expects as the first parameter the path to script and will interpret it. You can add further parameters like this: wcscript.exe test.vbs "C:\temp\" ...
25 Oct 2017 by Richard Deeming
Line 13, character 35 is: Set oDB = oAC.OpenCurrentDataBase strDBFullName ----------------------------------^ You almost certainly need to enclose the parameter in parentheses: Set oDB = oAC.OpenCurrentDataBase(strDBFullName)
30 Aug 2018 by Richard Deeming
Using PowerShell: $files = Get-ChildItem -path C:\Data\ -filter *.txt foreach ($file in $files) { $content = Get-Content $file if ($content -match "99999999") { $content = $content -replace "99999999", $file.BaseName Set-Content $file $content } }
21 Sep 2018 by Richard Deeming
Try PasswordLastSet instead of PwdLastSet. As far as I can see, there isn't a PwdAge property; you'll need to calculate it from the PasswordLastSet property. Something like this should work: Search-ADAccount -AccountInactive -TimeSpan 90 -UsersOnly -SearchBase "OU=User...
17 Dec 2018 by OriginalGriff
Use string.Split to break each line of the input in two: string[] parts = input.Split(','); Then use string.Format to "bolt them together" again: if (parts.Length == 2) { string output = string.Format("\"{0}\",\"{1}\"", parts[0], parts[1]); ... Or even like this: if (parts.Length == 2)...
28 May 2020 by F-ES Sitecore
Does the text output reflect what you would expect? Your fuel system code only sets the max value of the slider if startFuel > maxFuel, are you setting the values in the editor for when that condition isn't true? Also in ReduceFuel you set...
31 Dec 2021 by Adam Flow
document.getElementsByClassNam...
29 Jan 2022 by OriginalGriff
It's going to depend on your OS - the Linux diff is different from the WIndows version, but since you mention cat, I assume you are using linux for some reason. This may help: Shell script using Diff[^]