Questions tagged [windows-scripting]

Windows Scripting refers to any of the various scripting technologies that ship with Microsoft Windows products.

Windows Scripting refers to any of the various scripting technologies that ship with Microsoft Windows products.

With early roots in browser scripting, these technologies such as , Windows Script Host (), HTML Applications (), and are employed as system administration tools providing methods of automation.

As the name implies, Windows Scripting technologies utilize scripts written in plain-text interpreted code. Windows Scripting can become quite powerful when used to implement other technologies such as (OLE) Automation, Active Directory Services Interfaces (), and Windows Management Instrumentation ().

398 questions
101
votes
8 answers

How do I execute cmd commands through a batch file?

I want to write a batch file that will do following things in given order: Open cmd Run cmd command cd c:\Program files\IIS Express Run cmd command iisexpress /path:"C:\FormsAdmin.Site" /port:8088 /clr:v2.0 Open Internet Explorer 8 with URL=…
patel
  • 1,273
  • 4
  • 13
  • 15
72
votes
18 answers

PSEXEC, access denied errors

While I'm using PSEXEC.exe getting 'Access denied' error for remote systems. Any idea about how to solve this?
Pax
35
votes
4 answers

How to capture the Return Value of a ScriptBlock invoked with Powershell's Invoke-Command

My question is very similar to this one, except I'm trying to capture the return code of a ScriptBlock using Invoke-Command (so I can't use the -FilePath option). Here's my code: Invoke-Command -computername $server {\\fileserver\script.cmd $args}…
34
votes
4 answers

How can I verify that a string is a valid IPv4 or IPv6 address in batch?

I need to verify if a string is a valid IPv4 or IPv6 address in a Batch script, but apparently Batch doesn't have an easy way to parse an IP address. How can I do this in Batch without using external tools? By "external tools" I mean things that…
ThePirate42
  • 783
  • 4
  • 18
27
votes
2 answers

When to choose development of a PowerShell Module over PowerShell Script

I am about to write a PowerShell Script for Windows administrators, in order to help them in certain tasks related to deployment of a web application. Is there any reason I should favor or exclude the development of a PowerShell Module (.psm1)…
Olivier
  • 550
  • 1
  • 6
  • 8
17
votes
4 answers

How can I create a javascript library in a separate file and "include" it in another?

First, a caveat. The main script is not run in a webpage. I will be running the .js file in Windows using Windows Script Host. The problem: I would like to create a javascript "library" containing a number of objects, each with a number of…
user38735
13
votes
2 answers

Prompt dialog in WSH using JScript?

How to open a prompt dialog box in WSH usig JScript?? The only pop-up dialog I've found in the doc is the WshShell.Popup() method. But I need a way to request the user to enter a string, like the window.prompt() method in DOM. Thanks.
GetFree
  • 34,030
  • 17
  • 70
  • 101
12
votes
4 answers

VBScript getting results from Shell

Set wshShell = WScript.CreateObject ("WSCript.shell") wshshell.run "runas ..." How do I get the results and display in a MsgBox
Cocoa Dev
  • 8,655
  • 29
  • 105
  • 173
9
votes
5 answers

How to stop a vb script running in windows

I'm using windows 7 I wrote a script to check whether My Laptop is running in Battery or AC current. I googled it and succedded in that. dim a a=1 Do While a=1 If IsLaptop( "." ) Then ' WScript.Echo "Laptop" Else ' WScript.Echo "Desktop or…
shanmugamgsn
  • 800
  • 5
  • 15
  • 26
8
votes
4 answers

Do MS-DOS built-in commands return an error\exit code?

I have not found a way to get the error code, if returned, of rmdir. It seems like the MS-DOS internal commands do not return an error code. Can someone confirm that? How does a script that uses these commands know if the commands succeed or fail…
Duat Le
  • 3,576
  • 2
  • 17
  • 18
8
votes
3 answers

How does one output bold text in powershell?

I got a Powershell script that do some automatic procedures, I use a "Write-Host" at the end of each one of them to tell the technical user that step is finished, but I realize is kind of hard to read and keep track so, ¿Is there a way to output a…
8
votes
1 answer

Cannot add "-persist" to New-PSDrive - getting error "network resource type is not correct"

As the title says, if I try to add -persist to the cmdlt, it returns an error: New-PSDrive : The network resource type is not correct At line:1 char:1 + New-PSDrive -Name P -Root ... +…
8
votes
2 answers

How to compare if a folder exists and if it does not exist, create her

I have the following problem, I need to create a script that compares if the directory exists and if it does not exist, create it. In the linux shell, I use the parameter -F to check if the directory exists. How do I test in PowerShell? In Linux…
7
votes
1 answer

For loop recursively through folder in windows cmd for file rename

I'm trying to iterate through folders with images to create thumbnails using ImageMagic, and rename thumbnail files with small_ prefix. when I execute this in single folder, it works great: FOR %a in (*.jpg) DO convert %a -thumbnail 30% small_%a To…
Andrija
  • 12,383
  • 17
  • 51
  • 75
7
votes
3 answers

Loading the TypeScript compiler into ClearScript, "WScript is undefined", impossible task?

I tried using ClearScript to load the TypeScript compiler in order to compile some basic TypeScript code. Unfortunately, when executing the TypeScript compiler source I get this error: 'WScript' is undefined This is the LINQPad program I've used,…
Lasse V. Karlsen
  • 350,178
  • 94
  • 582
  • 779
1
2 3
26 27