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
6
votes
3 answers

Windows shell scripts in C#

I was pretty sure that some months ago I read about the possibility to launch Windows scripts not only the usual .bat, but also .js, .vbs and .cs ! I was willing to try windows scripts in C# .cs files this morning, but I can't happen to find any…
Stephane Rolland
  • 34,892
  • 31
  • 111
  • 159
6
votes
1 answer

Is There a Profiler for Windows Scripting Host Code?

Are there any profilers that can profile code that runs under WSH (VBScript, JavaScript, WSF)? Other than hand instrumenting with trace statements, what's a good way to profile code running under WSH?
Patrick Cuff
  • 26,370
  • 11
  • 63
  • 93
6
votes
4 answers

SETLOCAL ENABLEDELAYEDEXPANSION causes CD and PUSHD to not persist

I am trying to use setlocal enabledelayedexpansion and cd together in a batch script, which seems to not persist changes back to shell. The reason I need setlocal enabledelayedexpansion is that I need the variables in the script to be expanded…
Raghav RV
  • 3,510
  • 2
  • 17
  • 26
6
votes
1 answer

using Windows Script Host

I am using windows script host for some kind of installer application and I'm creating shortcuts in start menu with it. This problem came up when I switched to x64 environment (win7 ultimate x64+vs2010) I added a reference to Windows Script Host…
Axarydax
  • 15,785
  • 19
  • 85
  • 147
6
votes
2 answers

Why WScript.StdOut.Write method behaves differently in VBS vs. JScript?

I have two small programs in VBS and JScript: VBScript.vbs: For i=0 To 255 WScript.StdOut.Write Chr(i) Next JScript.js: for ( var i=0; i <= 255; ++i ) WScript.StdOut.Write(String.fromCharCode(i)); When I execute they in the command-prompt,…
Aacini
  • 59,374
  • 12
  • 63
  • 94
5
votes
2 answers

Is it secure to use a password argument in a Windows command?

Imagine that we have a program or script that can take a password (or other sensitive information) argument: > program.exe /password:secret For Linux, best practice generally recommends against specifying the password directly on the command-line…
Cy Rossignol
  • 14,070
  • 3
  • 45
  • 72
5
votes
1 answer

run batch script after windows server restart

I am trying to run a script to startup some services after windows reboot. I have tried one method: copying shortcuts of batch script in shell:startup folder. which eventually will start the scripts automatically but someone has to login to the…
5
votes
2 answers

Adding a logoff script

I have some scripts that I would like to run every time a user logs off. I would like to create something that programatically sets up the logoff scripts. For example, an exe or a cmd file that can be executed to add the logoff script to the list of…
Loduwijk
  • 1,852
  • 1
  • 15
  • 26
5
votes
4 answers

Command Line Script to Delete Header Row from a number of TXT files

What's the best method to delete the first line of text from a large (10k+) group of text files.
guazz
  • 51
  • 1
  • 2
5
votes
5 answers

Where does scripting fit in today

I was wondering what place scripting has in today's world of IDEs and GUIs. I'm new to programming and am wondering at what point I should, if at all, open up the PowerShell terminal for a particular task. What do people here use scripting for and…
user360907
4
votes
1 answer

Restart USB port WITHOUT reboot (DevCon)

UNNECESSARY BACKGROUND INFO: I purchased a new USB microphone (Samson Q2U) and I am having an issue where every time I (re)boot my PC, the mic does not work (it does receive power) until I unplug and re-plug the microphone from the USB port. Now…
Magnum
  • 43
  • 5
4
votes
1 answer

How to transmit a secure password over SSH using PowerShell?

I'm writing PowerShell modules that execute commands or scripts over SSH on remote Windows machines, and I'm looking for a way to transmit a password (or other sensitive information) over the connection. For example, imagine that we have a…
Cy Rossignol
  • 14,070
  • 3
  • 45
  • 72
4
votes
1 answer

How can script source position determined from inside an automation call?

I have a script host which runs JScript. There are some cases when I have to trace if a method of my exposed objects is called and from where it got called. For that I need to determine where is the script engine currently inside my object's method.…
r4w8173
  • 598
  • 6
  • 15
4
votes
3 answers

Does JScript support string trim method?

Whilst developing a Windows procedure using JScript, it seems that some string methods fail to work. In this example using trim, line 3 generates the runtime error: "Object doesn't support this property or method". My code: strParent = " a …
Andrew Shep
  • 59
  • 1
  • 4
4
votes
2 answers

Getting USB Storage Device Instance ID (unique ID) programmatically

How to programmatically get the Device Instance ID (unique ID) of a USB mass storage device that a user just plugged in?
Navaneeth
  • 587
  • 2
  • 7
  • 19
1
2
3
26 27