The tag has no wiki summary.

learn more… | top users | synonyms

6
votes
2answers
292 views

Determine if C drive has 2 GB of free disk space

I am trying to determine if a target pc has atleast 2 GB of free space. Here is what I have so far: @echo off for /f "usebackq delims== tokens=2" %%x in (`wmic logicaldisk where "DeviceID='C:'" get ...
0
votes
2answers
26 views

Assign DNS settings on client via elevated script in GPO

i have installed windows 2012 as a member server in my existing windows 2008 DC. now i want to assign secondary DNS on my windows 7/8 client PCs. I do not have DHCP in my environment. I tried to find ...
1
vote
2answers
1k views

.cmd in Windows Server 2008 task scheduler w/o highest privileges

Is it possible to run CMD script in task scheduler as a particular user without checkin option "Run with highest privileges"? Simple test: Create D:\Admin\Scripts\TestScripts\testscript.cmd ...
1
vote
2answers
2k views

net use mapping not working in batch files but works in cmd

Ok so here's the problem : I've got users using logon script in the domain (username.bat). The script simply lists 4 or 5 (net use letter: \\SERVER\directory\). However, when they open their session, ...
1
vote
3answers
40 views

cmd.exe, nested for loop, the variable cannot be use in option like skip=

I have many archive folder which stores the backup files. each folder increases daily. I need to delete all files except for recent N copies in each of them, N was defined by a variable from the ...
2
votes
1answer
38 views

NET USE - How to get list of all shares (elevated, non-elevated)

The command: NET USE Will display open connections by any process of current user. But, if command prompt (cmd.exe, or any shell) is non-elevated, it would display only connections opened by ...
2
votes
1answer
43 views

Provide Administrator credentials within script

I am writing a script that runs from a user account. The script needs to execute another script as the Administrator account. Tried AutoIt's RunAs - didn't work. Tried PsExec - the same. Tried ...
2
votes
1answer
135 views

dsadd run from batch file fails with “The specified account already exists” when there is no existing account with the same dn

I am programmatically creating thousands of test users from a txt file containing First Name, Last Name, Username, and Password using the following command (saved as a batch file, run in cmd, modified ...
1
vote
1answer
22 views

How can I know where and how a security group is triggering a logon script for some users?

The organization I work for has implemented application access and scripts via Security Groups. This is, if a person needs to access some applications or have a script run when he logs on, we add ...
2
votes
1answer
96 views

How to remove directories using wildcards by reading a file using batch?

Batch file for /f "delims=" %%f in (7profiledeletelist.txt) do rd /s /q "%%f" PAUSE exit 7profiledeletelist.txt C:\Users\1* C:\Users\2* C:\Users\3* C:\Users\4* C:\Users\5* C:\Users\6* C:\Users\7* ...
-1
votes
2answers
108 views

How to run batch file without a window in ONE file

I know how to run batch files without a window thanks to this question here: Run a .bat file in a scheduled task without a window. The first answer is the one I am using. It states that to run a ...
0
votes
3answers
42 views

Add a command into an existent remote console application

I manage to open a console application in a remote computer by using PSTools using PsExec.exe. C:\PsExec.exe -i 2 -s -d \128.168.500.500 -u username -p password "D:\myApp.exe" That will open a ...
1
vote
1answer
8k views

How to change the secondary DNS server entries on a network device via cmd? [closed]

In Windows XP, how do you change the secondary DNS server on a network adapter via the command line?
0
votes
1answer
655 views

sqlcmd is not recognised as an internal or external command, operable program or batch file SQL2014

I have written an installer that is supposed to install SQL Server Express 2014, create an instance, and then use sqlcmd to connect to the instance and build the database from a schema. It works by, ...
0
votes
2answers
47 views

Quit remote process and start it later

I have a console application running remotely in multiple computers. I was wondering if there's any way to quit from it remotely and then start it again. I saw the use of taskkill to quit the ...
6
votes
3answers
14k views

Current date in the file name

I have scheduled backup script that makes the database dump. How can I add the date timestamp to the file name? I am talking about Windows and CMD.
0
votes
1answer
3k views

how open a new cmd console on a windows 2012 server core after closing the last one?

On my new test server (windows server 2012 core) i've closed with the "exit" command the last cmd prompt. And now? how can i open another prompt? must i reboot the machine?
0
votes
0answers
22 views

When changing the Win display lang, will builtin CLI tools params / stdout|stderr messages also change?

I need to write a CMD script (other shells are not allowed / available) that will execute on multiple servers with different display languages. When looking at an Windows built in tool, such as ...
3
votes
4answers
9k views

How can I get the path to a Windows service executable WITHOUT using sc qc?

I need to query a windows service for the path to it's executable via the command prompt. I think the way I would do this is:sc qc myServiceName, but when I do that, I get the following error: ...
82
votes
8answers
138k views

Run a .bat file in a scheduled task without a window

I have a scheduled task that starts a batch script that runs robocopy every hour. Every time it runs a window pops up on the desktop with robocopy's output, which I don't really want to see. I ...
2
votes
3answers
2k views

Export Windows Server configuration to powershell script?

I'm looking for a way to export role/feature configuration to a scriptfile, like powershell. Lets say you've installed the DHCP-Role. You configure the scopes, reservations and all that stuff you ...
14
votes
7answers
25k views

Is there a global, persistent CMD history?

Sometimes I forget how the exact syntax of a CMD command looks and then I would like to search my own CMD history. Clearly, within the same session, you can browse it with the up and down arrow keys ...
0
votes
0answers
73 views

Windows 7 CMD tracert gives totally different final IP to online traceroute

So, i'm pretty damn rusty with this stuff, and been up all night for client emergency, so excuse me if i'm typing gibberish and didn't find related search results./ I'm suddenly taking over a clients ...
2
votes
4answers
7k views

How to run an elevated command prompt from the command prompt?

I have remotely connected to a Windows 7 computer via psexec and am running a remote command prompt on the Windows 7 computer. The command I am trying to execute requires that it be run in an elevated ...
0
votes
1answer
42 views

cmd /c behaves differently on server 2012

Tried writing a batch file to shutdown my 2012 server, but ran into a weird issue. For example on 2008 a batch file like the following runs as expected: cmd /c shutdown -s -t 0 On server 2012 when ...
2
votes
0answers
92 views

DNS Boot Method throuth dnscmd

Through the command line on Windows Server 2008 R2, dnscmd SERVER /Config BootMethod … the source from which the DNS server gets its configuration information (is determined) [→ ...
0
votes
0answers
17 views

understanding dnscmd /statistics values

On Windows Server 2008 (R2, 32-Bit) I have some problems in understanding the output of the following dnscmd \\SERVER /Statistics StatIDs: 00010000 → Memory: RAM? HDD? On my test server here I ...
2
votes
1answer
3k views

What happens when you type Exit in the CMD window on Server Core in an RDP session

I'm getting used to Server Core and I know at some point I am going to type "Exit" in the command window while connected through a remote desktop session. I know that if this is done while connected ...
2
votes
1answer
2k views

Force “net user” command to set password longer than 14 characters

I'm issuing some "net user" commands to setup a local user on my desktop for some testing purposes and require setting a password longer than 14 characters. In doing so Windows barks back a propmt to ...
1
vote
0answers
23 views

SED returning error 2 when launched by Wpkg

Case I am deploying a software product using Wpkg over Windows workstations. I need to disable product's faulty automatic update and the best solution in this case is to modify one configuration file ...
0
votes
1answer
79 views

cmd: create dhcp superscope

On Windows Server 2008 (R1, 32-Bit) I've got that far to create a superscope on the command line via cmd, not PowerShell (yay!) through netsh dhcp server \\SERVER scope IP.ADD.RE.SS set superscope ...
2
votes
1answer
93 views

set unlimited lease duration throuth CMD

On Windows Server 2008 (R2, 32-Bit, I found the following way to set the lease duration for, say, 3600 Seconds (1 Hour). netsh dhcp server scope 10.0.0.0 set optionvalue 51 DWORD 3600 [→ source] ...
-2
votes
3answers
48 views

How to Restore Win Drive Permissions [closed]

I've been playing with my C: drive permissions and I have managed to mess them up. Now when I log in nothing appears and I can't launch anything. I tried safe mode and the same thing happens with ...
0
votes
2answers
2k views

How to run multiple commands with psexec? [duplicate]

I need to run a command to uninstall forefront on some of our workstations and am having a bit of trouble formatting the command. Here's what needs to happen (in multiple commands) xcopy ...
0
votes
1answer
96 views

ping TOS values

Windows Server® 2008 offers ping -v TOS Type Of Service (IPv4-only) Trying to figure out what they mean I came that far that this has to do with IPv4's "Type of Service" Field – ...
1
vote
1answer
95 views

can't delete Resource Records through CMD in Windows Sever 2008

Final Update Problem erased in the least acceptable way: After re-installing the DNS-Server lead to even more problems, I re-installed the whole Operating System and - up to now - everything works ...
0
votes
0answers
24 views

(de)activate “Fail on Load if Bad Zone Data” through Command Line

One can (de)activate "Fail on Load if Bad Zone Data" Option in Windows Server 2008 (R2) through → DNS-Server → Properties → Advanced → (un)check this option. Question: Is ...
1
vote
2answers
2k views

How to “ignore” username and password prompt in net use

I have at the moment a logon.cmd script, that I'm using to map network drives to the users profile. It looks like this: ::Onboarding net use m: /delete net use m: \\BOB\onboarding ::Bookings net use ...
0
votes
1answer
100 views

cmd - delete IP from rule (Windows Server 2008)

I'm banning IPs using the Windows Firewall with these commands in cmd (actually in C# but using the cmd): pushd advfirewall firewall set rule name="BlockedIPs" new remoteip="1.2.3.4" action=block ...
-3
votes
3answers
627 views

How to check if internet IP address is currently taken? [closed]

Usually I check with ping {ip.address} and that kind of confirms someone has the ip, but when when I ping my Amazon server the message is Request timed out. However I know it's there and I can ...
1
vote
1answer
59 views

For in batch has weird behavior while reading folders

Im trying to do a simple batch (it is not the whole thing, but that's the part that is making everything fail) @echo off for /f "tokens=*" %%G in ('dir /s /b /a:d "e:\tmp\*"') do ( echo %%G ...
3
votes
2answers
4k views

How to run x64 bit version of registry from cmd.exe located under c:\windows\sysWow64

I have a 32 bit application which has to add a value to x64 bit portion of the registry. I want to do it through utilization of regedit.exe -s fileWithKeys.reg, However when I try to span regedit ...
0
votes
2answers
686 views

Properly escaping a path with spaces in CMD shell

I have the following path: "d:\workspace\Server trunk - CI\make\make & publish.bat" However, when I try to execute this from a cmd shell, I get the error: 'd:\workspace\Server' is not ...
-1
votes
2answers
96 views

Desktop backups maintenance on a network share

I have configured Windows Backup and Restore function on Windows 7 Professional desktops to make daily backup on a network share placed on a Windows Server 2012. (BTW It's a pity that this utility ...
3
votes
0answers
791 views

DSGET escapes hash signs (#) in outputted Distinguished Names (DN)s but expects unescaped hash signs for input

Lets say I want to do the very simple query in AD dsquery user -name "John Smith" | dsget user -memberof -expand This will output the DNs of the AD groups that this user belongs to. I can make it ...
0
votes
3answers
666 views

How to make the task scheduler display the cmd shell when invoking a batch file?

I am using Windows 2008 R2, and I am trying to schedule my application in the Task Scheduler. I have created a batch with the right settings. The problem I have is: I need to display the Cmd shell ...
-1
votes
2answers
170 views

Show Protected OS files using cmd.exe [closed]

I'm trying to deploy shortcuts from xcopy using a batch script to c:\users\all users\desktop But this is a hidden folder with Hide Protected operating System files tick box under Folder options. I ...
1
vote
5answers
86 views

Copying a chunk of output in Windows 7

I'm wondering how to copy a chunk of output in the command prompt in Windows 7. What I'm ultimately trying to accomplish is when I type "route print" I want to copy the IPs listed under IPv4 Route ...
0
votes
1answer
6k views

Application Error. The application failed to initialize properly (0xC0000142)

We are constantly seeing this error message on our Windows Server 2003: cmd.exe - Application Error The application failed to initialize properly (0xC0000142). Click on OK to terminate the ...
1
vote
7answers
9k views

how to get MAC address of remote computer

I have specific situation. I want to get MAC address from a remote computer, which is not in domain. I know the hostname and IP address of the remote computer. The IP Address of my computer is ...