Questions tagged [cmd]

Command Prompt (executable name cmd.exe) is the Microsoft supplied command line interpreter on OS/2, Windows CE, and all Microsoft Windows operating systems. Use this tag for questions regarding programming scripts or on commands available to run from the Command Prompt. Add tags for which version of Windows, and tags describing the task or issue.

0
votes
0answers
6 views

Is it possible to call another bat file without poping out a new command window in a batch file?

I was trying to do some pressure test in which there are a few batch files with calling relationship between each other. A batch file would use 'Call' to start another batch file. Considering that ...
0
votes
1answer
15 views

Lua: Can I select a table in script via argument in command line?

I have a lua script with many tables like local a = {1,2,3} local b = {1,2,3} local c = {1,2,3} etc. and one function like test = {} function test.set(args) for x, y in pairs(args) do .... ...
0
votes
0answers
20 views

Is it supported to use quotes in linux command? [on hold]

I need to run a python program on ubuntu using the command line. One of the parameter requires to use quotes. If I do not set value inside the quotes, everything seems ok (except my program will ...
0
votes
1answer
20 views

why i Can't install Google app-engine-java

enter image description hereEvery time i run "gcloud components install app-engine-java", i get "Restarting command: $ gcloud components install app-engine-java" this is happening even when i run ...
2
votes
1answer
31 views

XML - Modify element content(s) recursively based on matching criteria(s)?

I have an XML File, in which I would like to amend particular strings of text within elements based on different matching conditions which are detailed below. It may take a while to read and ...
1
vote
0answers
27 views

XML - Delete nested element based on matching condition then rename remaining elements?

I have an XML File, I would like to delete a particular element based on a matching condition, then rename/renumber the elements that remain. <AudioTracks> overall can contain a number of ...
0
votes
1answer
26 views

Using two or more set /p in the same line

Im trying to make a script that the user need to fill 3 spaces in the same line. Is it possibile? For example filling a date: 25/02/2019 in this way: day here / month here / year here Not line by ...
0
votes
0answers
18 views

how to echo environment variables inside an IF clause when SETLOCAL is enabled

how to "echo" the value of (environment) variables that should expand environment variables themselves? example BAT: echo OFF SETLOCAL echo running test ... set /a "YesPleaseContinue=0" IF ...
0
votes
0answers
10 views

Robocopy to mappled SharePoint online document library

I mapped a SharePoint online document library(Y:) and was planning to use robocopy to synchronize a local directly to the library. The problem that I am enountering is that it always views the source(...
0
votes
1answer
17 views

How to open another nodejs terminal from existing one

How to open another nodejs terminal from existing one, when an if condition is fulfilled.. I searched everywhere but can't find the answer. So to make it more clear for example: There is index1.js ...
0
votes
0answers
12 views

Why is catalina.bat not recognized by Windows command processor?

I am using Tomcat for deploying war application. Recently my system got completely reset and lost all environment variables and software I am trying to remote debug through Eclipse using set ...
0
votes
1answer
18 views

cmd script reading from file and writing to file loses empty line

I have a cmd batch script which: reads from a file line by line if the line matches the specified string, it outputs that line plus 2 new lines into the new tmp file if the line does not match the ...
-6
votes
0answers
18 views

How can a python Script gets you Instagram Followers [on hold]

Well , the problem is i once went to my friend's house and i saw him Using a python code to get followers . I verified that it's correct and works perfectly . I could not understand how it works from ...
0
votes
1answer
4 views

sc.exe alternative to find deactivated Windows service?

I use sc.exe to stop/start services on a remote \server in a pre/post build batch. Unfortunately sc does not seem to deliver any information about the service being deactivated or not which leads to ...
0
votes
1answer
26 views

Calling rsync in bash from Windows cmd

I am trying to run rsync from a batch file. The command is SET CMD="rsync -P -rptz --delete -e 'ssh -i /root/.ssh/CERTIFICATE.pem' SOURCE_ADDRESS /mnt/c/Users/MYNAME/IdeaProjects/PROJECT/SUBFOLDER/...
0
votes
2answers
57 views

Errorlevel not working when using date command in batch file

I've made this code to change the date. But when i enter a wrong date, the errorlevel command appears beeing ignored. @echo off @setlocal enableextensions @cd /d "%~dp0" mode 48,12 :start cls echo. ...
0
votes
0answers
29 views

How can I access exported .reg file using batch?

I exported registry keys to a .txt file using reg export command. I cannot read this file using for /f. I tried to change code page using chcp command although I didn't get any better. When I change ...
0
votes
0answers
41 views

How Can I run .net core self-contained deploy project without cmd (cmd should not prompt after running the project)

I have .net code SDC project, while running that project it open command prompt host my output on localhost://8000, now if I close the cmd my application will also stop. I don't want to stop my ...
0
votes
0answers
20 views

How can I change my windows display user name in command prompt?

I need to change my PC's cmd user name. Is there any way to do that? Like currently in cmd I get C:\Users\User Name> But I want C:\Users\User_Name>
1
vote
2answers
57 views

Modify repeating word/text in XML based on matching text/parameters?

I have an XML file, containing the following: <SubtitleTracks> <SubtitleTrack> <IsNotifying>true</IsNotifying> <Burned>false</Burned> <...
-1
votes
0answers
18 views

How to create system recovery partition from Windows 10

I am writing a program for Microsoft refurbishers, and I would like to include a feature for creating a system recovery partition once all the necessary drivers are installed. The problem that I am ...
1
vote
2answers
45 views

Is there a equivalent pwdx in windows? Or some workaround?

I just want to determine the working directory of a running process. In Linux you can use pwdx, but i cant find a similar tool in windows. It would be perfect to get a commandline solution. I tried ...
1
vote
0answers
20 views

echo batch file array element in for-loop using the iteration variable for the index? [duplicate]

This question is similar to that of Echo batch file arrays using a variable for the index? but it doesn't answer my question. I have a batch file that contains a list. I am iterating through a for ...
-1
votes
0answers
8 views

Why when I execute Ctrl + B in sublime the terminal I opened out of sublime?

When I give Ctrl + B in sublime to open the terminal and run the program, the terminal opens out sublimely, in a Windows cmd. I want it to be executed within sublime and not to be opened outside. I ...
0
votes
0answers
37 views

Is there a CMD command to refresh the “Date modified” in Windows?

I'm workin on a batch script that automatically copies all log files with a max age (n) to a new location. While testing the script i noticed, that there some log files were missing and the reason ...
1
vote
2answers
57 views

How to safely echo FOR variable %%~p followed by a string literal

I have a variable %%p created from for /f command When i try to use it with some additional references like: %%~dp and then write some text afterwards it accesses a different variable set var="%%~...
1
vote
1answer
31 views

How to pass parameters to MySQL script when running through cmd?

I am trying to pass parameters to my sql script via cmd on Windows but it does not work nor do I get any errors though. This will be running on a Windows environment and executed using cmd. I have ...
0
votes
0answers
23 views

Can't escape pipe character in windows CMD when echoing?

I am trying to pipe some commands via echo to plink over serial comport to a linux device. Most short commands work, but when I combined with a linux command that needs a pipe character "|" it breaks....
0
votes
0answers
27 views

Process is hanging itself during a while loop [duplicate]

My goal is to read the output delivered by the process and search for a specific string. Sadly my program is hanging itself when reading the fourth line of the output (where i enter the query). Most ...
-2
votes
0answers
21 views

Creating batch command lines of a csv

I have a csv file of our company employees , goes like this: FIRSTNAME,LASTNAME,USERNAME,PASSWORD,COMPANY I want to generate many command lines with this form of command and replacing the specified ...
0
votes
0answers
13 views

Getting Plink Serial connection to return to cmd or end

I am using command line Putty (Plink) in cmd for some automation was able to redirect some commands to execute some serial comport commands to my device. However, once it finishes executing the ...
0
votes
0answers
8 views

Colorama not working in VSC or CMD when displaying lines that should be colored

Colorama for Python 3.7.3 is not outputting colored lines in Visual Studio Code or CMD, just weird strings. I've already tried from colorama import init init(convert=True) init() from colorama ...
0
votes
1answer
11 views

I want to be able to run my Python through Atom like i have been able to do on my phone with dcoder

So Im very new to programming and computers in general... Over the last couple months i have learned everything i know on my phone using Dcoder with android. I have been searching for a program that ...
0
votes
0answers
51 views

Opening and closing excel using batch without losing data

I am trying to write a batch file that will open two Excel documents and close them without losing data. I need this because the first document is automatically downloaded from the Internet every day ...
1
vote
0answers
17 views

How do I echo parameter in batch file using a for loop [duplicate]

Some parameters of my batch file are echoed, while others are not. I would like to see the name of the solution file in the echo statement as well as the name of the solution being built. Here is the ...
0
votes
0answers
12 views

error: no module name cx_oracle when running the python from cmd

I am getting the error no module named cx_oracle when trying to run the script in CMD when running in spyder the script works steps to reproduce 1. cd to directory where my python.exe is located 2. ...
0
votes
1answer
93 views

The process won't wait?

the code i use is as below: begin saSecurity.nLength := SizeOf(TSecurityAttributes); saSecurity.bInheritHandle := True; saSecurity.lpSecurityDescriptor := nil; FillChar(...
0
votes
1answer
13 views

How do I save cmd output from msbuild to a log file in a for loop?

I have several Visual Studio 2015 solution files that I would like to build using a command line. I would like the output stored in a single file Here is the contents of a batch file that builds the ...
-1
votes
0answers
13 views

Reupload file through FTP if it fails due to connectivity. Need ideas

I have set up a batch file which uploads generated txt files to a FTP server every hour. There are two folders, when the batch file runs and uploads the txt file, file is moved to the other folder. ...
-1
votes
0answers
18 views

Batch script does not print variable [duplicate]

I have a quick question, as I am new in batch scripting. In the code below, the desired output is "Your name is Tomas" (for example), but the code does not print the variable and only says "Your name ...
0
votes
0answers
18 views

renaming hidden extensions which was automatically added

I am trying to launch a script as mentioned in this link https://github.com/coursera-dl/coursera-dl it needs a file coursera-dl.conf I created the file with required parameters. A screenshot is shown ...
1
vote
2answers
46 views

How to echo double quote into file without new line in Batch?

I want to write " sign using Batch in the file. echo| set /p=""" >> abc.txt This doesn't work as intended because it gives errors sending data to my file. Any ideas?
1
vote
1answer
46 views

How to exactly replicate the behaviour of Windows cmd shell mkdir with Python?

I am trying to find a way to programmatically create folders on my PC, which selectively sync through "Ignore files with these extensions" filter to my Google Drive storage with Back Up And Sync app. ...
-3
votes
1answer
55 views

How to go to a Directory in cmd/java [on hold]

In Java, I wrote a simple program which catches a file and gives that file's path to cmd to do something. If java gave me a path: C:/Users/Asus Fx/Desktop, (note the space between Asus and Fx), I'd ...
0
votes
1answer
58 views

redirecting the output of a python command to a txt file working in cmd but not in .bat file, how to solve?

well I'm trying to make a logger for my python script using a runner in a '.bat' format, that executes the script and saves an output file; without me having to do it manually. when I tried to run my ...
-1
votes
0answers
21 views

How to add prefix to files in Windows CMD?

I have .jpg images in a folder and they may have one or two chars in their names I need to add the same prefix to all the images If I try the command REN D:\Folder\*.jpg prefix_??.* it adds the ...
1
vote
1answer
38 views

windows core run command with elevated privileges

There are a few options for standard user to run as Administrator (or any another user), however, even when logged as Administrator, some functions requires to run 'elevated'. On a windows gui, just ...
-1
votes
0answers
23 views

Where are password hashes located on Windows? [on hold]

Is there any possibility to get Windows password hashes from a Windows command? Where are they're located?
-1
votes
0answers
40 views

How to create Windows shortcut with run as admin, in Batch or Powershell?

I wondering if there is a way to create shortcut in Batch or Powershell, with run as admin checked in Shortcut, right click, properties, advanced, run as admin And with special Target like : C:\...
0
votes
5answers
99 views

CMD/BAT get date modified of all filenames and append to their filename

I am having trouble with this script. I'll explain below the codeblock. @Echo off pushd "\\server\folder" SETLOCAL EnableDelayedExpansion @FOR /F "TOKENS=2" %%A IN ('WHERE /T "testfiles*.*"') DO @( ...

http://mssss.yulina-kosm.ru