Questions tagged [windows-command-prompt]

Refers to the default CLI that ships with all versions of Windows, often shortened to just "command prompt" or cmd (after the file name of the executable).

84 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7 votes
0 answers
3k views

Windows: 'Query User' command reporting idle time inaccurately (false positives)

I'm working with ten other sysadmins that sometimes forget to log out of servers (or even lock them). For two days or more, I've been trying to come up with a 'script' that'll check each server we ...
soj4trade's user avatar
7 votes
0 answers
1k views

cmd.exe as a built-in application pool identity

My IIS web applications run using the built-in application pool identity IIS APPPOOL\Foo. Is it possible to run a command-line in the context of IIS APPPOOL\Foo using psexec or some other tool? ...
Heinzi's user avatar
  • 2,237
4 votes
0 answers
5k views

Palo Alto Globalprotect - connect via cmd

Scenario: Windows box having the Palo Alto Globalprotect vpn client installed. Is it possible to use commandline or powershell to connect the vpn client to a remote host? I know this is possible ...
Rasmus's user avatar
  • 143
4 votes
0 answers
1k 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 ...
Justin Dearing's user avatar
3 votes
1 answer
3k views

Exit code 0x84C40013 in silient installation of SQL 2008 service pack 3 installation

Following Command is utilized for installing SQL SP3 pack in Windows server 2008 R2. start /WAIT C:\Temp\SQLSP3.exe /quiet /IAcceptSQLServerLicenseTerms /Action=Patch /AllInstances This complete ...
Sudheer Muthusamy's user avatar
2 votes
2 answers
342 views

Delete all files within a directory within a specific subfolder

I have seen and tried a few solutions online but these don't seem to be working. I don't need a recursive function. Basically I have a directory with numerous subfolders which all have subfolders of ...
Amy Rose's user avatar
2 votes
0 answers
732 views

Strange character inside dates in "net user" command output

When running the net user username /domain command in cmd, all the dates (Password last set, Password expires, Password changeable and Last logon) have a strange character before the individual dates ...
Goozak's user avatar
  • 121
2 votes
2 answers
6k views

Change Registry Key Permissions Access Control List using only Command Prompt

I am trying to change the Access Control permissions on a specific registry key i'm generating using a batch file. I try using regini.exe to pull the configuration from a .ini file and run into ...
Joe Bales's user avatar
2 votes
1 answer
6k views

how to have gpresult on remote comupter outputted as xml or html?

I'm on a Windows 2016 server and I'm trying to get the RSOP from a Windows 2008 remote computer using the command GPRESULT. However when I use the command: gpresult /S 10.0.52.234 /U Administrator /P ...
person personson's user avatar
2 votes
0 answers
745 views

Autocomplete in CMD.exe from psexec

I am not sure if this is the best place to ask. But I am just wondering if it is possible to have autocomplete in cmd.exe / powershell.exe spawned by psexec.exe? For example: psexec \\127.0.0.1 -u ...
Timothy Leung's user avatar
2 votes
0 answers
2k views

Check microphone level and change accordingly via script

I am trying to check what the existing volume on client workstations is and set to x (let's say x = 16.5). I figured out how to set the volume via cli which is using nircmd. To be specific: nircmd....
user3421341's user avatar
2 votes
0 answers
445 views

How do I add an iscsi target to a windows initiator through stock cmd?

I have many Windows Servers that need to run headless but I need to add many iscsi targets to each of the Windows hosts. I already have the iscsi target setup and have access to IP address of where ...
Rusty Weber's user avatar
2 votes
2 answers
493 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 CMD's ...
Omar's user avatar
  • 21
2 votes
0 answers
806 views

Trying to run a netsh batch with foreign characters

I am trying to run a batch file with the following content: netsh interface ip>set dns "Połączenie lokalne" source=dhcp The file is saved as ANSI. My Windows codepage is 1250, the OEM one 852. ...
Tin's user avatar
  • 21
2 votes
0 answers
2k views

Access Denied error when running xcopy in jenkins on windows 2008 r2

I have installed Jenkins on a Windows Server 2008 R2 and in the build script i use xcopy to copy the generated war file to a specific folder The problem I am having is that every so often the build ...
Aegis's user avatar
  • 123
2 votes
2 answers
975 views

How Can I Create Multiple Files of a single file in multiple Directories?

Hello I am trying to create multiple copies of a single file in multiple directories? for example I have 6 folders with a single file in each folder named lp.html, How can I run a batch to create 100 ...
Jesus Landra's user avatar
1 vote
0 answers
722 views

Windows test network folder permissions for another account

How to test that an account other than login account has access to a network folder ? Here's an example : I'm logged in as steves but I need to test if joej has access to : \\contoso\dept\finance\...
BaltoStar's user avatar
  • 207
1 vote
2 answers
628 views

cmd pipe -> System cannot find specified path

Using cmd on Windows 10 Pro 21H2, when I try echo Hello | find "Bye" I get The system cannot find the specified path. Same thing if trying echo Hello | C:\Windows\System32\find.exe "...
Toni Homedes i Saun's user avatar
1 vote
0 answers
155 views

Is it possible to open a file within a batch file as another user?

im trying to run psql.exe (postgreSQL) with an active code page set to 1252. I want to have a batch file that opens up a command prompt with that code page, then navigates to the psql directory to run ...
Vanillaice's user avatar
1 vote
0 answers
917 views

Open url with parameters with cmd

I changed default program for .docx and set to myopenwith.bat So when I clicked to any docx, it will open with myopenwith.bat myopenwith.bat has this code: start firefox https://www.dropbox.com/search/...
Aleksandar's user avatar
1 vote
0 answers
501 views

using start /wait for a headless process in a batch file - any way to show the process is running?

So I have a large batch file, and in the middle it hits a start /wait command to run a silent install of an MSI. I'd like to have some animation or something to indicate that the batch file is in fact ...
Luke's user avatar
  • 577
1 vote
0 answers
2k views

Set Proxy automatic configuration script from command prompt

I'm running into a problem where I'm running a script to clear the automatic configuration settings found below,and it does clear the windows when you check through the UI. However, it doesn't seem ...
ZeRaTuL_jF's user avatar
1 vote
0 answers
154 views

Redirect Console Output ,Terminal (macOS, CentOS) / Cmd (Windows) to Remote Syslog or Server Logs

I have One workstation running multiple instances of Java applications by Console/Terminal for Testing, and I develop an application for Listening Logs, TCP like (http://esus.com/using-java-util-...
Anita's user avatar
  • 111
1 vote
0 answers
1k views

How to Check for the Java Process Running on All Network Computers?

Due to Oracle's shenanigans, our organization has decided to remove JRE from all computers under our maintenance contract. They've also decided to not replace it with OpenJDK JRE, so I've been tasked ...
DeathNTaxesNTaxes's user avatar
1 vote
0 answers
665 views

Do I need to have identical user account on different domains to run a net use command via batch script?

I have a Task Scheduler task that runs a batch file which copies a file from server1 to server2 on a different domain. Note:The scheduled task is running on Domain_A using user accounts created to ...
ShruS's user avatar
  • 11
1 vote
1 answer
413 views

Windows PATH Variable with a Drive-letterless path

At work, we have a setup where our product's source code is mounted to a drive letter, and if you want to have different builds, you have different drives. The build tools are reached by adding ...
Katherine1's user avatar
1 vote
0 answers
458 views

Sending Message To User From Remote Computers

I have 4 networks. 10.22.227.0\24, 10.28.43.0\24, 10.0.3.0\24, 10.0.6.0\24. In total there is some where around 250 users. What i would like to be able to do is send the user a message from my ...
Kelly's user avatar
  • 15
1 vote
2 answers
3k views

How to find a file in cmd and then piping the output in findstr

I have a simple question regarding how to finding a file in cmd and then piping the output to findstr to nail down a specific file. For example, dir change /s /p | findstr "error" Can this be ...
gsb005's user avatar
  • 111
1 vote
1 answer
964 views

Windows Server Backup and Restore Command Line or pgAdmin

Newbie to postgresql, I come from an Windows background with Backup Exec and Veritas GUI driven applications, I also have a Centos bacula background. If this is in the wrong forum, please move. I ...
Tech.Kid1961's user avatar
1 vote
1 answer
317 views

Making secondary Ip addres primary, without disrupting internet connectivity

I'm adding a secondary IP address with this command: netsh interface ipv4 add address "Ethernet" NewIp 255.255.255.0 After that, I want to make this address primary (default), without disrupting ...
F Andrei's user avatar
1 vote
1 answer
2k views

How to catch "The system cannot find the file" within For /F loop?

How to catch "The system cannot find the file" within For /F loop? I would like my code to do the following: 1 - Search for the specified file 2 - If file not found, handle the "The system cannot ...
Mr. Elliott's user avatar
1 vote
0 answers
76 views

Data Execution Prevention - Optout for the exe in “C:\Program Files\SSS\sss.exe” using Command Prompt

Can any one help me in adding "C:\Program Files\SSS\sss.exe" in DEP Exception list using Command Prompt?
Sudheer Muthusamy's user avatar
1 vote
1 answer
24 views

Why command from script file isn't found by windows?

I've added drush command to environment variable. When I go to cmd and run drush command all works ok. But wheh I'm trying to call drush command inside script file, eg: #!/bin/bash drush si --site-...
Codium's user avatar
  • 123
1 vote
0 answers
60 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 ...
bogdan's user avatar
  • 65
1 vote
1 answer
167 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 ...
Michał Sacharewicz's user avatar
1 vote
1 answer
190 views

for loop windows cmd

I'am using Windows cmd to calculate some variables. The command works fine: gut adapt_gf -InFile sla1.nc -OutFile sla_grid1.nc However, I have many sla values (sla1.nc,sla2, sla3, etc). Is there ...
Tim's user avatar
  • 11
0 votes
1 answer
116 views

ssh from CL using keyfile from Windows client to Linux server

This sort of thing drives me crazy - hopefully obvious solution(s). Have keys on Win 10 laptop, and on one of my Linux servers. If I use puTTY, where I can explicitly browse to the keyfile on the ...
Johnny Canuck's user avatar
0 votes
0 answers
80 views

Trying to import a specific portion of the local security policy template for account lockout

I am trying to implement a solution to modify the local security policy on client machines using SECEDIT and a provided inf file, however /IMPORT requires the /db parameter to be listed but I cannot ...
MasonBitByte's user avatar
0 votes
0 answers
74 views

Add context menu for file passing multiple parameters to target

I would like to use an AI subtitles sync program (Alass). This is very simple in Linux/bash but I was trying for a way to achieve this using Windows and the context menu. So here my requirement: make ...
rs232's user avatar
  • 105
0 votes
1 answer
271 views

Start exe as current logged in user

i am creating exe shortcut on Windows startup folder while installing application. It was automatically starts on Windows start and restart. I want check on every 5 mins whether the exe running or not....
Hisanth's user avatar
0 votes
1 answer
2k views

Renamed executable files Cmd and Utilman and now its not opening

I forgot my windows password So I tried to change "Accessibility" to "Cmd" on Sign-in windows by following these steps: Opened Advanced Startup Menu > Trouble Shoot > ...
Aakash Gujar's user avatar
0 votes
1 answer
1k views

check MD5 checksums from md5 file in Windows

Hopefully a simple question, does a simple Windows command line equivalent to md5sum --check [files.md5] exist? Alternatively, something I can script as a batch file. I can generate the hashes file ...
16shells's user avatar
0 votes
0 answers
958 views

How to close connection when using PSExec on multiple remote computers?

I am using PSExec to run scripts on multiple computers and after a few computers I start getting connection errors (probably because of concurrent connections limit on Windows 10). PSExec command I am ...
jacob_w's user avatar
0 votes
1 answer
285 views

How can I disable the Windows Game DVR from the command line?

I need to disable the Windows Game DVR for a collection of Windows computers that will be running student exam / testing software, so that students can't use the Game DVR hotkeys to record the test ...
Dale Mahalko's user avatar
0 votes
0 answers
2k views

No User exists for 'query user'

I have one weird issue on the virtual machine. When I do 'query user user1' is not showing the active session of the user. It says 'No User exists for user1', though there is active connection. ...
Ela's user avatar
  • 101
0 votes
1 answer
522 views

How to reset the "allow pc to be discoverable on this network" prompt?

I have been advised to ask this question here on ServerFault. I've searched StackExchange, StackOverflow, and Google and I'm not finding any insights on how to reset the prompt when first connecting a ...
k1dfr0std's user avatar
  • 101
0 votes
0 answers
183 views

detect rdp ram remotely with FreeRDP without x server (x11)

i've installed freerdp on my ubuntu vps i got it from digital ocean after few problems regarding the x server problem and freerdp can't work without x server i able to configure it to check the ...
Dark.Attacker's user avatar
0 votes
0 answers
496 views

how can find list of the sites connecting to the app pool using appcmd.exe

I can see a list of site and list of app pool separately. but how can I find wich site using from the app pool. e.g: we have an app pool with name: app1 i want to send command to find how sites ...
User12's user avatar
  • 89
0 votes
1 answer
523 views

Fast File Copy script in Windows

I have a process that is run every month or so. Such process identifies a set of files and constructs a proper source and destination path from several fields of different tables in DB to then copy ...
Carlos S. Na's user avatar
0 votes
1 answer
304 views

ICACLS escape asterisk character

Let's say I have managed to create a file named '*' (via MSYS or whatever) Is there a way to properly escape this such that I can call ICACLS and only list that single file? icacls * lists everything ...
LordAro's user avatar
  • 121