Questions tagged [cmd]

0

votes
0

answer
9

Views

Is there a way to get the install path of all installed programs?

im working on a personal project that opens other programs and currently I am using a text file where I have to manually enter the path to the exe file like this C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe I wanted to know is there a way to get a list of all the locations of e...
BimBim SalaBim
0

votes
0

answer
13

Views

Is there a way to add values to a function in cmd module for python (when using the program)

I am having issues with the CMD module in python. I need to be able to add values after a do statement like for example: def do_test(self,x,y): calculate = x * y print (calculate) Ive tried reading the original documentation on the python websites about the cmd.py but im having a hard time understan...
TankyGarn
0

votes
0

answer
14

Views

DLL load failed : Python modules accessible through Spyder but import fail in cmd

I have seen many more or less related questions on this topic, but none helped me finding a way to solve my problem. I'm not very familiar with Windows environment, deep apologies if my question sounds obvious to some extent. Setup: Windows 10 Python 3.7.0 (installed through latest Anaconda release)...
EdouardIFP
0

votes
1

answer
13

Views

How to change the color of text in Quotation mark in CMD (win 10)

The color of the text in Quotation mark in CMD is red by default and the background is black. It's very hard to see the text in Quotation mark. How can I change the color of the text?
Nazmus Shakib
1

votes
1

answer
15.6k

Views

cmd / powershell: minimize all windows on your desktop except for current command prompt (console) or except for some particular window

well, I know how to minimize all open windows on the desktop from a batch file by using powershell method - MinimizeAll(): powershell -command "& { $x = New-Object -ComObject Shell.Application; $x.minimizeall() }" the problem is: this method minimizes everything including current cmd-console which...
escudero380
1

votes
1

answer
195

Views

Can't execute powershell script function using PHPs shell_exec

I'm trying to pass arguments from a PHP page's POST request into a powershell script. This is the relevant PHP snippet: $selectedPartner = $_POST['partner']; $selectedGroup = $_POST['group']; $script = "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe AddRemPartners"; if (isset($_POST[...
Tikiyetti
0

votes
1

answer
17

Views

How to pass string or parameters from batch file(cmd) to excel vba program or excel cells?

I am running multiple batch files. I would like to pass message(string) when batch files starting and ending to excel vba code or excel cells.
Anavarathan
1

votes
2

answer
52

Views

Exit cmd (or shutdown) after ffmpeg done

Is there a command to automatically close cmd (or shutdown the pc) after a ffmpeg command have been executed? I'm using this command to download a video: ffmpeg -i link.m3u8 -c copy video.mkv And I want that cmd will close, or the pc will shutdown, after done downloading.
MA.SE
0

votes
0

answer
15

Views

How to create simple volume from unallocated partition

I'm trying to open a place on my harddisk to store some licensing files. So far I have tried diskpart. It looks easy to use but I could not format the unallocated partition with diskpart. I have found a way to create the unallocated space but I have to format it to use(correct me if I am wrong here....
Shino Lex
1

votes
3

answer
7.3k

Views

I want to try netcat commands in cmd in win 7 , but this is the result:

this is my result , please help me about it http://i.stack.imgur.com/SKNAS.jpg
m.ghoroobi
1

votes
3

answer
550

Views

Issues with spaces in FOR loop variable - batch script

I'm writing a batch script that will use a WMIC command to get a list of all groups on a Windows machine, get the group info by using net localgroup , and then write the info to an output file. Here is what I have: for /f "skip=1" %%a in ('"wmic group get name"') do net localgroup %%a >> "%OUTPUTF...
Austin Eyler
0

votes
0

answer
5

Views

Dir > txt cmd from WiFi Attached Storage

I have some movie files stored on a FileFub Plus which is a wifi hub with a sd card – which I can access over my LAN. Once I connect to the FHP’s wifi (entering password etc) I can access the files through my Win7 File Manager using the address \10.10.10.254. What I want to be able to do is run...
UltraFusion
1

votes
1

answer
565

Views

run java program from cmd with class imports from jar files

Hey community I have this rookie problem so if anyone could help that would be great :) So here it goes... I'm trying to test the stanford NLP parser by trying to run the java demo file which is included in the file you can download from here My problem is probably on the imports of the classes inc...
catchiecop
0

votes
0

answer
4

Views

| was unexpected at this time

I am trying to locate a file using dir and findstr to be able to specify the extension and a pattern in the name. For this, I use the following command: for /f %%a in ('dir /b /s *.pm | findstr /i "MyPattern"') do (set "name=%%a") The question has been mostly answered in here, here and in here. But...
user2536125
1

votes
1

answer
464

Views

Resize Command prompt on bat file

Is there any way to start a .bat file and resize the window to a custom size from the code? I don't want to change it from the cmd.exe file because i want it to be dynamic (I want to make a few .bat with different sizes) @ECHO OFF rem **Something to resize here** rem Rest of the code... pause Thank...
driconmax
-1

votes
0

answer
24

Views

How to execute multiple commands on multiple disk drives in a batch file

for %%A in (c: d: e: f:) do (batch list of lines) %%A I have tried variations of FOR/D looping, goto, parameter passing and calling batch files and am just not getting the syntax or method correct. There has got to be a simple way to pass parameters or structure a loop to run multiple commands on se...
Hairy Query
1

votes
1

answer
1.3k

Views

Batch script - Set/Define environment variable if not already set/defined

I need a batch script to be invoked as SetEnvironmentVariableIfNotSet.bat environment_variable_name from another script or the command line. I am by no means specialist in Windows batch scripting but by trial and error and piecing different things together, so far I've came up with this: @setlocal...
CristiArg
1

votes
2

answer
961

Views

Windows CMD %ERRORLEVEL% in nested IF

In a Windows 7 logon script first I want to test, if a certain file exists. If (and only if) that is the case, I want to test, if a certain registry key exists. If that is not the case, I want to do some stuff. So here's what I came up with: IF EXIST %SOME_FILE% ( REG QUERY "HKCU\..." /v some_key IF...
Thomas
1

votes
1

answer
613

Views

mysql won't change my root password,

I'm having a serious troublesome situation trying to reset my MySQL's root password. I'm following the dev.mysql.com instructions: Step 1. Log on to your system as Administrator. Step 2. Stop the MySQL server if it is running. For a server that is running as a Windows service, go to the Services ma...
Marcus
1

votes
1

answer
3.6k

Views

Loop through a list using a batch file

I am attempting to write a batch file to automate the process of rebooting some IP cameras i have on a server. I have successfully got a batch file to reboot one camera, via ftp, but I'm having trouble understanding how to do it for every ip in the range. I currently have: open IP user pass quote si...
Thom G
1

votes
1

answer
28

Views

Close cmd while Tk object remains

So I made a simple calculator in Python 3.7 and made a batch file to get it to run from the CMD. The thing is, after I run the batch file, I get a CMD window and then the Tk window, but the CMD window remains there and shuts my program down if I close it. Is there a way to hide the CMD window or jus...
Akenaten
1

votes
1

answer
194

Views

A windows batch script open a file chooser dialog or drag-and-drop file to it

I try to write a batch script that, when you drag and drop another file to it, it will do something. If you don't drop anything, just double click it, it will open a file selection dialog window. For the first part, it's easy: @echo off bin\dosomething "%~1" For the second part, I googled this threa...
kaikaiiiiiii
1

votes
2

answer
92

Views

CD to a Volume Serial Number (VSN) in cmd

Briefly, is there a way to magically use cd following by a volume serial number instead of drive letter? Generally, when I open command prompt and want to move into a drive like E: I would enter the following command: cd /d E:/ I'm writing a batch script to copy a file into my flash drive, but I don...
Brian SP
1

votes
1

answer
27

Views

command at that run from cmd isnot working

I run the following AT command in windows CMD: at 8:52 "start calc" it is scheduled and can be seen in the list when running "at" but when reached the time it is not executed as accepted and when running "at" again it is deleted from the list ??? What is the reason and how to fix it ? See the screen...
user3879626
1

votes
2

answer
42

Views

How to identify latest application build folder based on folder name

I am struggling to find an intelligent way to determine the latest build folder that is among a number of other folders and I hope someone can point me in the correct direction. Main Application Install Path: C:\Program Files\ABC Subfolders: MiscFolder01 MiscFolder02 AppName 5.0 AppName 5.0.0.0 App...
Bill
1

votes
1

answer
26

Views

How to find all header files in directory and subdirectories in Windows

i recently started working on windows operation system(2012 R2) and i am trying to find all files with header format (*.h) in my directory and it subdirectories . this how i got it when i ran in linux shell : find /auto/sw_work/fwshared/ibrahims/git/svx/pci_verification -name "*.h" i got the fol...
Ibrahim Shalhoub
1

votes
1

answer
108

Views

'vim' is not recognized in cmd if it's opened via explorer address bar?

I have added VIM's folder to the PATH environment variable. So, I can access the editor in any terminal I have simply by typing vim. Everything's okay. But there's one peculiarity which puzzles me. It doesn't work. I get 'vim' is not recognized as an internal or external command, operable program or...
Ahu Lee
1

votes
1

answer
51

Views

Trouble setting Batch variable to output of command

I have the following line in a .BAT file attempt to get a UTC string. FOR /F "tokens=*" %g IN ('powershell -command "Get-Date -date (Get-Date).ToUniversalTime()-uformat %Y-%m-%dT%H_%M_%SZ"') do (SET VAR=%g) Which makes use of this PowerShell line which works from command prompt. powershell -command...
Geesh_SO
1

votes
3

answer
43

Views

List all folders and subfolders in a given structure with filesize

I'm trying to list the folderstructure of a disc and each folders size. I've got the folderstructure down, now i just need to output each folders size. According to https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/dir there is no flag for displaying filesize - only hi...
Joel
1

votes
3

answer
58

Views

Get all files with a specific extension

I am trying to get a file with a specific extension from a directory. To do that I am using the following batch file code: for %%f in (.\*.ext) do ( echo %%f ) This works fine, unless I have a file with .extsomething extension. I tried adding the $ wildcard to get only the exact matching, but it doe...
Garry White
0

votes
0

answer
4

Views

BATCH \ If a variable is set a certain way, how do i make the hole “echo %variable%” disappear

Example code: @echo off set test1=cat set test2=dog set test3=empty set test4=empty echo %test1% echo %test3% echo %test2% echo %test4% pause >NUL This launched script will look like this cat empty dog empty How would I go about making the launched script look like: cat dog But without deleting the...
k9-primetime
1

votes
1

answer
720

Views

Add a line in middle of txtfile in cmd

here's a text file txtfile.txt line1 line2 add after this line line4 etc etc i want to create a batch file which can add a line after add after this line with the user entered info. keeping the add after this line intact. example: enter info: asdf and the file becomes line1 line2 add after this line...
Nisham Mohammed
1

votes
2

answer
18.6k

Views

How to execute cmd command from text file?

As title says, I need to execute cmd command from text file.Let's say I have text file called file and in it it's written Color A.I need something like command: type file.txt and not just write it on screen, but I want it to press enter meanwhile.Batch file options are welcomed too.Thank you.
Matt Martin
1

votes
1

answer
15.6k

Views

cmd / powershell: minimize all windows on your desktop except for current command prompt (console) or except for some particual window

well, I know how to minimize all open windows on the desktop from a batch file by using powershell method - MinimizeAll(): powershell -command "& { $x = New-Object -ComObject Shell.Application; $x.minimizeall() }" the problem is: this method minimizes everything including current cmd-console which...
escudero380
1

votes
2

answer
911

Views

Unable to run exe from C# Process Class

I am trying to execute an .exe file from from C#.NET Process class, but I am Unable to do so. I am able to run the .exe from Command prompt successfully. Below is the Successful command prompt output I am Using the below C# Code . I have not done anything outside the below code. string output = stri...
Kinnan Nawaz
1

votes
2

answer
1.1k

Views

close batch file after execution in java

I am trying to create a bat file and running it. Once execution is complete, bat file should close. String cmd = "cmd /c start" + " "+"java -jar batchfilepath"+" "+"\n exit"; Runtime r = Runtime.getRuntime(); Process pr = r.exec(cmd); Issue- I am able to close the bat file but it closes before execu...
Khalith Basha
1

votes
3

answer
3.7k

Views

create curl command in windows 7 command line

I downloaded the curl.exe file from the curl website and put it in my c drive. C:\curl.exe . How do I make that a shortcut in the command line? For instance, instead of typing "C:\curl http://www.google.com", I would like to just type "curl http://www.google.com"
David
1

votes
5

answer
634

Views

CMD Exception Handling C/C++

I will use some CMD commands in my program and these commands might throw some exceptions. And as you know, when an exception accours, CMD writes its own error message the screen. But, I want to write my own error message. My question is this: Is there a way to block CMD messages and write only my o...
ciyo
1

votes
4

answer
32.2k

Views

Running Assembly programs in command prompt w/ windows 7

I was wondering how to run debug in command prompt in Windows 7. I have looked this up online, finding only that you can find the debug.exe in the System32 file, but it is not. If this is not possible, is there any other comparable program for compiling and editing Assembly programs?
Elias Benevedes
1

votes
1

answer
184

Views

How can I run my Java program with a set “name” in the command line?

I'm very new to all Java related programming. For a school assignment, I've created my Java application using BlueJ. Apparently, the application should be able to run from the command prompt with the following line: myapp -compress fileName Honestly, I don't have the slightest idea about how to setu...
Voldemort

View additional questions