People who code: we want your input. Take the Survey

Hot answers tagged

17

The issue is that the start command (built into CMD) has a special way to handle the first parameter with quotation marks, which is to specify an optional title for the created window; without the first set of quotation marks (like the solution below), the start command is interpreting the command shown in the question as follows: Create a window with a ...


5

Batch scripts have a few variables they can use to get special information about the script. %1 to %9 are the parameters that were used after calling the batch script, but %0 is the full path including the filename itself of the batch file. So if the batchfile is stored on the desktop, %0 would be: c:\users\user\Desktop\test.bat Given that %0 gives us this ...


3

This one-liner should do that: icacls C:\path\ /t /c | findstr C: | findstr /v (F) Explanation: icacls will list all files and their permissions the first findstr command will isolate the lines containing file names, omitting other lines the second findstr will find lines that do not contain "(F)" that stands for full-control.


3

FTP (like http) is unencrypted. FTPS adds encryption (like https). The walkthrough you linked to is for ftp, and specifically turns security (SSL) off, so even if you can connect via ftps it still wont be encrypted - which means any party between you and the server can intercept the traffic (and get your password). In order to secure your connection you ...


2

Iterate over all files or directories: for %%i in (*.html) do ... for /d %%i in (*_files) do ... Note: In .bat scripts you must use %% for the iterator variable, while the interactive shell uses only a single %. Remove a file extension (only works with iterators, not variables): %~ni, %~xi for %%f in (*.html) do echo %%~nf_files Replace a substring (only ...


2

In PowerShell you deal with processes using Get-Process Get-Process firefox |% { $_.PriorityClass = 'BelowNormal' }


2

I don't know when ffmpeg truncates the output file, before or after starting to process the input files. To avoid destroying the first input file too soon, I'd let ffmpeg write to output.avi, and then if ffmpeg exits successfully rename it: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.avi \ && mv output.avi "$(head -1 mylist.txt)&...


2

Yes it could be evidence of a virus or malware Yes you may be able to get back the command prompt by doing the following: Run powershell as admin Run the command sfc /scannow It will repair missing or corrupted system files.


1

The problem is that if the first parameter to START is a quoted string, it will assume that it is the intended title. If you need to pass a quoted string for the executable because of spaces in the pathname, put an empty string "" as the first parameter to START: START "" "C:\Program Files\Mozilla Firefox\firefox.exe" Editorial ...


1

Why did Microsoft exclude .ps1 files from PATHEXT (i.e. stop them being run directly)? As already pointed out in the comments, likely security. PowerShell is a relatively capable automation tool with a number of built-in Cmdlets, including ones that can affect Windows or be used to download files from the internet. Disabling PowerShell by default helps ...


1

I found the answer from github " https://github.com/pbatard/Fido " Fido is a PowerShell script that is primarily designed to be used in Rufus, but that can also be used in standalone fashion, and whose purpose is to automate access to the official Microsoft Windows retail ISO download links. GNU General Public License version 3.0 or later. ...


1

If delayed expansion is the solution, how to use it? As follows: @echo off setlocal enabledelayedexpansion if 1==1 ( call :label echo !errorlevel! ) pause >nul endlocal exit :label exit /b 1 Delayed Expansion will cause variables within a batch file to be expanded at execution time rather than at parse time, this option is turned on with the ...


Only top voted, non community-wiki answers of a minimum length are eligible