I’m trying to execute a Powershell script from CMD which receives a SecureString object as an argument as follows: pwsh.exe -Command ".my_script.ps1" -Password (ConvertTo-SecureString XXXXXX -AsPlainText) This works fine on my machine with Windows 10 and Powershell 7.1, but shows the following error in Windows Server 2012 with the same version of Powershell. Cannot process ..
For example I have a directory named "Files" which contains a multitude of subdir. But then I only want to list the files inside the subdirs that follow a pattern, for say "2021-07-*" Is it possible to do this in one line? I tried using dir /s /b C:UsersXXXXFiles21-07-*. However, it only returned the name ..
I installed pydictionary using pip: pip install pydictionary It says that it has been installed, and I can see it in the PATH library, but the import command on CMD or Visual Studio Code doesn’t work. I use: Windows 10 Home; pip 21.2.1; python 3.9.2. Source: Windows..
I’ve got a bunch of text files in a directory that have a block of text I want to extract between two strings into a new text file of a similar name. I’ve got the single file working but think I’ve come unstuck with looping through all .txt files. Maybe at the "goto" command? Here ..
Hope you can help me out here. I’ve been playing around with some SSH authentication. I have no idea why this is happening, but now when I run a simple ssh-keygen command I get a response saying Access is denied. in addition to a pop-up that reads "This app can’t run on your PC. To ..
I am using this answer to batch create folders & move files based on file names. My files are TIFs, with this naming schema: 12345_001.tif 12345_002.tif 12345_003.tif 12346_001.tif 12346_002.tif 12347.tif 12348.tif My code: @echo off for /F "tokens=1,2 delims=_." %%a in (‘dir /B *.tif’) do ( md "%%a" 2>NUL move "%%a_%%b.tif" "%%a" ) Some files ..
Inside the %list% txt file there are multiple paths and inside %List2Backup% there are multiple files list only, I need to copy each file to each server name location based on first server name only example of location from %list% TestServer1D$Location1DraftsTestings TestServer2C$Location1DraftsTestings I want files to be copied to "%~dp0BackupDlls_%Environment%_%format:~-0,30%TestServer1filename.dll This is the current code ..
cmd suddenly stopped working (was using it while learning machine learning and obviously did something wrong in the process), I tried simple fixes but none will work. The window just doesn’t open up at all. Tried it on a different user and it works fine there. Is there anyway to solve the issue? Source: Windows ..
Default answer is %~dp0. And most times this will work fine. But there is a bug in cmd.exe which will prevent this from working correctly under certain circumstances if you use double quotes to call the batch. Double quotes are necessary if the name or path of the batch file contains spaces. So for convenience ..
I am trying to install a plugin from Domoticz, and I need to do it via python, but im new to the python terminal. I am trying to do the following command "pip install git+https://mygithublink#egg=name" but I get the followng error: ERROR: Cannot find command ‘git’ – do you have ‘git’ installed and in your ..