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).
388
questions
175
votes
11
answers
353k
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 ...
158
votes
13
answers
331k
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 ...
1
vote
0
answers
33
views
Running windows container's command prompt and a command
I am running Windows Nanoserver in a container.The nanoserver contains only the command prompt and nodejs that I have installed at the build time and it lacks powershell.
I want to execute certain ...
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?
...
-3
votes
2
answers
72
views
Why can't I cd to my file in cmd? [closed]
I'm typing cd ~ C:\Desktop\gitPractice
And I get this return:
bash: cd: too many arguments
What do I need to fix here in order to be able to change directory?
0
votes
1
answer
5k
views
Windows 10 - Shell commands for CTRL+Alt+Del not working
We have an icon with a target path of "explorer.exe shell:::{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}" which pulls up Windows Security window in order for users to select change password from ...
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 ...
0
votes
1
answer
171
views
Windows hello for business: remove certificate from virtual smartcard
I've managed to add a certificate to windows hello for signin to RDP.
See: https://learn.microsoft.com/en-us/windows/security/identity-protection/hello-for-business/rdp-sign-in?tabs=intune
However ...
0
votes
1
answer
123
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 ...
1
vote
1
answer
480
views
Managing Orphaned .avhdx Files in Hyper-V with PowerShell
I'm managing a Hyper-V environment and looking to clean up my hard drive to free up space. Specifically, I want to delete orphaned .avhdx files and possibly move some to external storage. I prefer ...
2
votes
1
answer
7k
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 ...
53
votes
2
answers
81k
views
Windows: redirect stdout and stderror to nothing
I have a command I am running produces a ton of output, I want to silence the output without writing to a file. I have used the following to send all output to a file:
command > out.txt 2>&1
...
28
votes
1
answer
31k
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
2
answers
1k
views
winget not working unless I do
When I open Powershell, and type winget - this is the response:
winget : The term 'winget' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of ...
0
votes
0
answers
93
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 ...
0
votes
0
answers
90
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 ...
0
votes
1
answer
284
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....
0
votes
1
answer
41
views
SFC Couldn't Perform Requested Operation -- Options?
I had a user come to me with her company issued Dell laptop. After the "Dell" splash screen is done, Windows does not boot. It's just a blank, black screen. After rebooting several times via ...
0
votes
1
answer
520
views
Can we use RoboCopy to synchronize data?
I have a project where we are moving from on-premise file share to AWS FSx.
I need your suggestion on data synchronization. I decided to use the RoboCopy tool to copy the data. We need to also copy ...
2
votes
3
answers
5k
views
Trigger a scheduled task "At task creation/modification" schtasks
I am creating a schedules task to run just before it's created and deleted after it runs.
I am using the tool, schtasks to create the scheduled task, but i havent found the parameter to run the task "...
0
votes
1
answer
428
views
How can I determine which network adapter a device is using for packet emission when attempting to reach a specific IP address using ping?
I have been trying to reach a particular IP and I have not been able to check on which Network Adapter it is using for publishing. Is there any way to check on a particular device to verify whether it ...
12
votes
8
answers
14k
views
How to remove 'Administrator:' from the command promt title
In Windows Vista, is there a way to remove the word 'Administrator:' from the title of a command prompt window?
The 'title' command just updates the part after 'Administrator:', so that will not do.
5
votes
2
answers
19k
views
Using "sc" command to control services with whitespace in name
I need to stop service on remote machine. The problem is that service name contains whitespaces, and I get a message, that such service does not exist.
sc \\machine stop "service name"
How can I fix ...
19
votes
6
answers
95k
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:
[SC]...
0
votes
1
answer
99
views
Why cant i kill the task remotly through my .bat Script? [solved]
I want to write a .bat Script, where i want to kill a task remotly from my pc on my windows server 2022.
When i try the command "taskkill /u Administrator /p mypassword /s 192.168.178.226 /im ...
19
votes
3
answers
106k
views
call batch file and run using its own path/directory
I have a batch files that calls other batch files like this:
e:\foo\master.bat has the content:
call e:\bar\run1.bat
and e:\bar\run1.bat has the content
app1.exe
the problem is that when I run ...
2
votes
1
answer
638
views
PS Stop-Process fails to stop a subprocess launched from cmd.exe
Preface: I've boiled down a problem I'm having to this simple reproduction, which admittedly looks pretty strange out of context.
From powershell (PS), if I use Start-Process to start notepad and ...
-1
votes
1
answer
2k
views
Add Network Printer using command /Powershell after exporting it from One Machine to Another Windows 10/11
AIM : To export Network Printer from one Windows 10 machine to an output file and using that output file import it to another Windows 10 machine on the same network.
Research work:
The following ...
1
vote
2
answers
2k
views
Takeown You do not have permission to read the contents of directory
Is there a reason I get this error when taking ownership of a directory?
It works fine if I go through the permissions in the GUI, but if I try to do if from the command line I get an error that I ...
0
votes
2
answers
8k
views
Generate SHA256 Hash of a STRING from Windows Command Line
While this is simple to do in the *nix world, I can't come up with a solution for generating a SHA256 hash of a string from the Windows command shell (not PowerShell) without installing a 3rd party ...
22
votes
9
answers
88k
views
Capturing output of remote process from sysinternal's psexec
I'm trying to capture the output of the remote process from psexec (i.e. not psexec's own output). So, for example I could run "ipconfig" and print the output to a log file.
I have tried:
psexec \\...
0
votes
5
answers
1k
views
How to get coloured file listing in windows cmd shell?
A few older ones in here will probably remember a cute little proggie from DOS days, hdir it was called. Did nothing special, except show the file and directory listing in colour.
(there were others ...
0
votes
1
answer
765
views
Can forfiles search multiple drives in the same command and create a txt file of results?
Can forfiles search multiple drives in the same command and create a text file of results? I have the following that works to show me the results in command prompt but what I really need is a .txt ...
0
votes
2
answers
2k
views
Activate and specify logon script without user interaction
I would like to remotely activate a logon script to computers (Win10 and 11) not connected to a domain.
I can already remotely deploy software/script/files as admin, for example: I can deploy a logon....
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 > ...
-1
votes
1
answer
316
views
Local user login on a domain machine, receiving System error 5 occurred Access is denied error
We are trying to use the command prompt net group from a local login on a workstation.. This workstation is on the domain, but I'm logging in as the local user: .\localuser and not the domain\user.
...
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 ...
1
vote
0
answers
784
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\...
0
votes
2
answers
3k
views
Powershell / Command prompt cannot switch to mapped drive when running as another use
in my powershell prompt, logged into a Windows 10 PC as Domain\UserA i can run the net use command to see my shared drives
net use
lists
+--------+-------+----------------+---------------------------+
...
37
votes
4
answers
36k
views
Given a PID on Windows - how do I find the command line instruction that executed it?
On a database, I can get a list of all the currently running processes, and the sql command that kicked them off.
I'd like to do a similar thing on a windows box.
I can get the list of processes, ...
1
vote
1
answer
2k
views
How to run cmd.exe using the system account on Windows 11?
I want to run cmd.exe not as administrator, but as the local system account on Windows 11.
Apparently it was possible on Windows 10 using psexec. On Windows 11 with psexec v2.40 I get this error from ...
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 ...
2
votes
3
answers
3k
views
Windows Server "Core" Reopen CMD Window In Nested RDC
This question is very like this other: Open a new cmd console on Windows 2012 Server core after closing the last one?
With one key difference that is not addressed in the other and which I have not ...
4
votes
2
answers
2k
views
command line utility to connect to wireless network
Can any one tell me a command line utility to connect to a wireless network in Windows XP.
I cannot use netsh wlan as this is not supported in XP.
Is there any open source command line utility tool . ...
5
votes
1
answer
10k
views
Running windows container's command prompt in admin mode
I am running Windows Nanoserver in a container.The nanoserver contains only the command prompt and lacks powershell.
I want to execute certain commands inside the container in the command prompt which ...
0
votes
1
answer
3k
views
IIS ftp server issue from command line
I'm trying to config an ftp server on IIS (Windows Server 2008 R2)
I configured basic authentication with read,write permissions for a user and no SSL
I also opened port 21 on server firewall
then ...
47
votes
9
answers
124k
views
System error 1219 has occurred
I am trying to connect to a remote server and deploy a service there, through a deploy script.
I start by stating "Net use" and send the credentials for the server.
But here I get system 1219 error:
...
5
votes
2
answers
11k
views
How can I get the list of app pool using appcmd.exe
we using the below command to get the list of the site added in is:
%systemroot%\system32\inetsrv\AppCmd.exe list sites
but the above command can not take a list of app pools related to the site.
I ...
0
votes
1
answer
28
views
Windows DEL command behavior wrt junction points
In my installer script I want to delete known files from known locations on the local PC using the DEL command. The command should purge the file from a certain folder and all subfolders below that. ...
22
votes
7
answers
145k
views
command line - switch to administrator mode
Is it possible to switch from normal mode to administrator mode in command line? I don't want to open command line by right clicking and selecting "run as administrator". Thanks