Posts by It Wasn't Me • 1,897 points
127 posts
-
0
votes1
answer33
viewsA: Add value of a variable in a record
I’m sorry, but I think you’ve complicated your logic/code... It would be nice to add the contents of your file MD5-PAF-ECF-LINX.TXT, just to get a better idea of what you seek to achieve with your…
-
0
votes3
answers93
viewsA: Open Multiple Programs at Once CMD
There are options: 1. Run the program in the background (background): Start /b 2. Open Chrome in windows, tabs in or both not in private/ incognito mode: start "" /b chrome --new-window for %%i in…
-
1
votes1
answer33
viewsA: How to send the results of multiple Findstr commands to only one.txt file?
You have options using redirectors > >>: >Sobrescrever no arquivo It will write in the file regardless of whether the file exists or not, in case there is no file, the redirector…
-
2
votes2
answers140
viewsA: Batch counter
To get the total number of lines without saving in variable: At the command line or at bat: %__AppDir__%\find.exe /c /v "" ^<.\tmp.txt To get the total number of lines and save to a variable on…
batchanswered It Wasn't Me 1,897 -
3
votes1
answer148
viewsA: Can anyone explain what that expression is for and how to use it?
Items of 1. to 5.: I have already done some research and I have a basic notion but I wonder if anyone could clarify what this expression does and how it does. Items of 6. to 9.: ...copy more recent…
-
1
votes1
answer55
viewsA: DOSBOX does not recognize some batch script commands, how to resolve?
1. The Title is not an internal or external command of the MS-DOS, nor the Dosbox 2. Dosbox proposes to emulate in "software", the disk operating system environment and the necessary physical…
-
0
votes1
answer35
viewsA: Create a . bat <source>"filename_2021_01_10_code" <target> another server
1. For each execution, take the date: > wmic OS Get localdatetime 20210128183243.207000-180 2. Save to a variable using a for /f loop > for /f %i in ('wmic OS Get localdatetime ^|findstr /r…
-
0
votes2
answers394
viewsA: Vb script to call an executable
exeName = "%windir%\notepad" To expand the variable %windir% in the code, you can use: Set wshShell = CreateObject("WScript.Shell") WScript.Echo wshShell.ExpandEnvironmentStrings("%windir%")…
vbsanswered It Wasn't Me 1,897 -
0
votes1
answer109
viewsA: VBS script to change the computer name
Dim objShell Do Choice = InputBox( _ " ENTER THE CORRESPONDING NUMBER. . ." & vbCrlf & vbCrlf & _ " 1 - Check PC Name" & vbCrlf & _ " 2 - Change PC Name" & vbCrlf & _ " 3…
vbscriptanswered It Wasn't Me 1,897 -
1
votes1
answer110
viewsA: Script help . bat does not read spaced words
@echo off setlocal EnableDelayedExpansion set/a "_tag=0,_num=0" && pushd "D:\AM-2.6.1\ROMlists" echo========================================================== echo= AM Favorites ROMlist…
batanswered It Wasn't Me 1,897 -
1
votes1
answer100
viewsA: Replace filename via MSDOS prompt
*/ EDIT 1. You have to use variable replace/substring (changes to the content of the character string in the variable that stores the name), in your case, define the name and operate the…
-
0
votes1
answer50
viewsA: Update Application Version Automatically - Cordova
Can anyone know exactly what is occurring this error? Or some way to update the version automatically? 1. Redirect all command output lines CALL npm version for archival version: CALL npm version…
-
0
votes1
answer305
viewsA: Copy files with error: System cannot find specified path
@echo off %:^{ set/p "_ano=Entre o Ano a ser criado: " || goto %:^{ <con: cd/d "%~dp0" && pushd "%USERPROFILE%\Documents\2.SERVI?OS\00.DOCUMENTOS_PADROES" set…
-
1
votes2
answers168
viewsA: I need to compress several separate files with powershell
sl 'C:\Arquivos\Log'; dir *.log | % {& "${env:ProgramFiles}\7-Zip\7z.exe" a $_.BaseName $_.Name} 1. Enter the folder where you want to create your files or at least point to it: # Entre na…
-
1
votes1
answer179
viewsA: How to capture the result of a command and store in a MS-DOS variable?
@echo off title <nul & title .\%~nx0 setlocal & cd /d "D:\videos" set "_hash=%cd%\mp4_hash.txt" set "_ff=%ProgramFiles%\FFmpeg\bin\ffmpeg.exe" if not exist "%_hash%" >"%_hash%" (…
-
1
votes1
answer256
viewsA: How to hide batch input (password)
@echo off && setlocal enabledelayedexpansion <con: cd /d "%~dp0" & color 0a && mode 60,8 title<nul & title Folder Lock/unLock Script && >nul chcp 65001 set…
batchanswered It Wasn't Me 1,897 -
0
votes1
answer120
viewsA: Cmd - query and export in single file. Sql
Try using for /r loop with copy /b /y listao.sql+"file_in_loop" listao.sql : >nul cd.2>listao.sql & for /r "C:\Users\jefer\Desktop\Integracao" %i in (*.sql)do copy /y /b .\listao.sql+"%~i"…
-
0
votes2
answers185
viewsA: A bat that copies a file to a folder named after it
@echo off cd /d "%~dp1" set "dir_orig=C:\teste\" & set "dir_arq=C:\teste\%~n1" :: arquivo="BCB _20200115.zip" :: Verifica se o diretorio não existe IF NOT EXIST %dir_arq%\ md %dir_arq% 2>nul…
-
0
votes1
answer35
viewsA: Cmd admin to no admin
Explaining, what happened versus what you saw... I saw in this link that it is possible to change to Adm in Win7. No, you didn’t see this, what you saw was just the execution of a code that checks…
promptanswered It Wasn't Me 1,897 -
0
votes1
answer879
viewsA: how to copy a file name using cmd and rename another using copied text (Clipboard) only with cmd windows commands
You are literally counting the oxen by the paws It would be simpler to take the Clipboard out of the process or use it only at the end: 1. List your arquivo.csv most recently created/amended: dir…
-
1
votes1
answer107
viewsA: Could someone explain this batch code to me?
The for /f is a command for use in loopings, where it will allow to obtain and manipulate the information that returns from its execution, whether by invoking a program, an internal/external command…
-
0
votes2
answers166
viewsA: How to create the boolean AND condition in a . bat code?
Use dir with multiple files and use the errorlevel set "_wow_path=%ProgramFiles(x86)%\World of Warcraft\_retail_\Logs" 2>nul >nul dir /b "%_wow_path%\WoWCombatLog.txt"…
batanswered It Wasn't Me 1,897 -
0
votes1
answer516
viewsA: How to set variable using substring in batch code (Windows CMD)
*/ EDIT How do I set ORACLE_SID only with the final part of the service name, and how do I return it only once, without repeating the same ORACLE_SID value earlier? - Note: The answer also covers…
-
2
votes1
answer958
viewsA: How to run bat file by Delphi
Invoke the command interpreter cmd.exe WinExec('cmd.exe /c "e:\socket\startNodeJS.bat"',SW_SHOW); cmd.exe /c = executa comando/bat e fecha/close cmd.exe /k = executa comando/bat e mantém/keep…
-
0
votes2
answers597
viewsA: Change user password (Active Directory) using php and powershell
Try invoking the powershell using: -NoProfile -Command "seus comandos" == -nop -c "seus comandos" Or else. -Ex -Command "seus comandos" == -ex -c "seus comandos" Where your php with powershell would…
-
5
votes2
answers291
viewsA: Cmd text box functionality for Git
The date format/layout/strings in the variable %date% changes as: region, language and/or settings made by the user: The variable %date% will always display the date in the format according language…
-
8
votes3
answers2879
viewsA: Run script with Python: command "python3" is not recognized
Update: 1) Download an official version of Python 2) Use custom installation by following the screen clippings below. 3) Perform your somador.py direct on the command line just by typing the name…
-
1
votes3
answers280
viewsA: Run cmd command with CD
Whereas the path to the api has already been set in the variable %path%, you have already tried only to run call composer update? Look at that answer Running "Composer update" Within a Windows . bat…
-
1
votes1
answer231
viewsA: Insert msdos command into a vbscript file
Not tested with the output of Anydesk.exe, then it may occur the output does not give in the: WshShellExec.StdOut.ReadAll Then I’d have to switch to: WshShellExec.StdErr.ReadAll strCommand = "cmd /c…
-
1
votes2
answers439
viewsA: Settings . bat running a . dstx
About how to do to get data/hora in the best way and make use to compose the layout in substring/variables/filename, I suggest you consult these two answers So en/EN Q224040 SO-EN Q12635541, plus…
-
0
votes3
answers2225
viewsA: File . bat does not run
To avoid errors, you can go checking if the station is UP (suggestion from @Oldschool), this before sending the command to turn off, another important thing, would be to send some warning to the…
-
3
votes1
answer124
viewsA: Generate a pop-up window in R
Needs to be using svDialogs? Apparently, it only works in interactive mode or in it (running inside the RStudio). Is there any way the pop-up can be displayed by running the code through the file .…
-
1
votes2
answers258
viewsA: How to validate if a login is valid inside . bat
1) Limit login using a loop for %%@ in (1,2,3), that for when %%@ == 3. 2) Get the input length and the total of letters present in the variable, 3) Concatene o comprimento da entrada + as letras…
-
0
votes2
answers331
viewsA: Script vbs to restart a service if it is "stoppered"
Suggestion using your vbs adapting the service status check to when stop startar again: set wmi = GetObject("winmgmts://./root/cimv2") qry = "SELECT * FROM Win32_Service WHERE Name='Spooler'" for…
-
1
votes2
answers2094
viewsA: Create folder in . bat with variable name
You’re a little confused to understand your question... @echo off & title <nul & title .\%0 && set "number_of_agents=" :loop set/p "-= Type the numbers of PATHS that you want to…
batchanswered It Wasn't Me 1,897 -
2
votes1
answer291
viewsA: Access denied for remote access via WMI
Remote access has to be enabled on the station by a configuration that is done locally, not just send an access request and/or a command, the other stations where (in another domain or not) your…
-
0
votes1
answer247
viewsA: Set environment variables via shell_exec php
In fact the value is altered, but the associated access of the volar updated occurs in a new instance/session. The shell_exec("setx VAR_TEST '2' /M") will create the variable or change its value if…
-
0
votes1
answer123
viewsA: Manipulation of records (regedit)
1) A key that is liable to read/write, is the key used to global variables: Use HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment 2) Possibly not very suitable, but likely to…
-
1
votes1
answer322
viewsA: How do xcopy copy a directory from a variable
To enter the directory, use the command set /p : It opens an entrance so you can insert/digest what you want to go to the variable: set /p _nome_variável= rem :: Opcionalmente, pode incluir um texto…
-
1
votes1
answer552
viewsA: Batch Script to Select Files by Data
@echo off & setlocal enableextensions enabledelayedexpansion & title <nul mode 79,10 & color 0a & title Q38135.cmd set "_bck=D:\Documentos\Desktop\Shopsync" set "_Zip=C:\Program…
batchanswered It Wasn't Me 1,897 -
0
votes3
answers647
viewsA: Copy file to Clipboard using Powershell
About which of the options is the question? Archive? or Content? 1) Copy the Own Archive (copy and paste filing cabinet) 2) Copy the Contents of the Archive (Copy and paste contents) For shares of…
-
0
votes2
answers223
viewsA: xcopy does not find the destination files
Try replacing: mes%\*.\.* for mes%\*.* xcopy /I /Y /E /C /Q /G /H /J /S "\\pdv-01\Arquivos Fiscais\Arquivos Fiscais\Documentos Eletrônicos\CF-e-SAT\%ano%\%mes%\*.*"…
batchanswered It Wasn't Me 1,897 -
1
votes1
answer49
viewsA: Error when identifying user login "-Identity"
You have that task mentioned in that article/link: https://www.petenetlive.com/KB/Article/0001475 1) note the use of Foreach-Object , and not the Foreach 2) note the use of $.'User-Name' , and not…
powershellanswered It Wasn't Me 1,897 -
1
votes2
answers142
viewsA: Is there any way to make the "Curl" program to pause print the information on the screen?
Here is the suggestion to know the unxutils, these are some linux executables already ported to the Windows platform, including the less curl --help | less.exe The unxutils is available on this…
-
1
votes2
answers137
viewsA: Find 2 occurrences in powershell
For the purpose of exemplifying the answer, I replaced String1/String2 adding String3 : String1 --> pizza String2 --> chocolate String3 --> soda pop What suits me for this kind of task:…
powershellanswered It Wasn't Me 1,897 -
0
votes1
answer171
viewsA: Concatenate . html files into a . htm with Powershell
Possibly there may be multiplicities of encoding in the content of your html files, I suggest testing using -Raw and replace -Encoding UTC8 for String: Get-Content -Raw *.html | Set-Content…
-
2
votes2
answers2019
viewsA: Automatic download by bat - View file date before download
Just see the file date getting last modification:` cUrl.exe -# -I https://www.rarlab.com/themes/WinRAR_Noia_Bogart_64x64.theme.rar |find "Last-Modified" output: Last-Modified: Tue, 15 Dec 2009…
-
1
votes2
answers130
viewsA: Set variable with highest existing number in file
A hint using the commands set along with find in a loop for ordering from major to minor. @echo off && setlocal enabledelayedexpansion cd /d "%~dp0" & (for /f %%i in (lista.txt)do set…
cmdanswered It Wasn't Me 1,897 -
1
votes2
answers110
viewsA: Problems in batch droplet
Some options to sound the alarm: @echo off & setlocal enabledelayedexpansion & cls & title nul & title Alarme^!! echo/ & set /p "alarme= [!time:~0,-6!] Defina um tempo para o…
-
2
votes2
answers1693
viewsA: How to remove accent using bat/cmd
Welcome to the ONLY! No command to create user named folders without the accents! Unfortunately we do not have a command to perform the task of "remove accents" provided by the operating system…