batch-file

create a command line argument .bat file that can change all .exe file compatibility settings in a specific directroy

£可爱£侵袭症+ 提交于 2020-05-09 06:50:50
问题 I have multiple drives with a different directory structures. I have a directory called "test files" with of several .exe files that I need to change the compatibility settings to "run this program as administrator" Is it possible to create a windows .bat file that runs as Admin and that can change all the .exe files compatibility settings in a specific directory and all its sub-directories, regardless of where "test files" is located, to "run this program as an Administrator" This is what I

Time is set incorrectly after midnight

狂风中的少年 提交于 2020-05-08 16:51:26
问题 i am using the following to set the date/time to something more readable: set day=%date:~4,2% set mth=%date:~7,2% set yr=%date:~10,4% set hur=%time:~0,2% set min=%time:~3,2% set bdate=[%day%-%mth%-%yr%]-[%hur%-%min%] this works well and outputs something like : [02-06-2020]-[22-59] How ever after midnight the time format changes from HH:MM:SS:MS to H:MM:SS:MS and messes up the format and when it includes the : in the time, since the characters are shifted over by one, when i make the log file

Time is set incorrectly after midnight

允我心安 提交于 2020-05-08 16:47:07
问题 i am using the following to set the date/time to something more readable: set day=%date:~4,2% set mth=%date:~7,2% set yr=%date:~10,4% set hur=%time:~0,2% set min=%time:~3,2% set bdate=[%day%-%mth%-%yr%]-[%hur%-%min%] this works well and outputs something like : [02-06-2020]-[22-59] How ever after midnight the time format changes from HH:MM:SS:MS to H:MM:SS:MS and messes up the format and when it includes the : in the time, since the characters are shifted over by one, when i make the log file

Powershell and german umlauts in git branch names

被刻印的时光 ゝ 提交于 2020-05-08 10:14:03
问题 I have written a batch file which uses a powershell command to delete all local git branches except one to keep. If there are german umlauts used in branch names, it does not work. Switched to branch 'master' Your branch is up-to-date with 'origin/master'. Deleted branch DEV_API_StartenDesWorkers (was 61bec6d883b). error: branch 'DEV_Üersicht_Drucken' not found. error: branch 'test_pr├â•�fung' not found. The correct names are DEV_Übersicht_drucken and test_prüfung . How can I achieve to

Powershell and german umlauts in git branch names

↘锁芯ラ 提交于 2020-05-08 10:10:53
问题 I have written a batch file which uses a powershell command to delete all local git branches except one to keep. If there are german umlauts used in branch names, it does not work. Switched to branch 'master' Your branch is up-to-date with 'origin/master'. Deleted branch DEV_API_StartenDesWorkers (was 61bec6d883b). error: branch 'DEV_Üersicht_Drucken' not found. error: branch 'test_pr├â•�fung' not found. The correct names are DEV_Übersicht_drucken and test_prüfung . How can I achieve to

Powershell and german umlauts in git branch names

我们两清 提交于 2020-05-08 10:10:29
问题 I have written a batch file which uses a powershell command to delete all local git branches except one to keep. If there are german umlauts used in branch names, it does not work. Switched to branch 'master' Your branch is up-to-date with 'origin/master'. Deleted branch DEV_API_StartenDesWorkers (was 61bec6d883b). error: branch 'DEV_Üersicht_Drucken' not found. error: branch 'test_pr├â•�fung' not found. The correct names are DEV_Übersicht_drucken and test_prüfung . How can I achieve to

Unable to pipe cmdlet objects in cmd

对着背影说爱祢 提交于 2020-04-30 07:35:43
问题 i am using this powershell command to fetch a particular user profile "Get-WmiObject -Class Win32_UserProfile | Where-Object {$_.LocalPath -eq 'C:\Users\Pela'}" But when i am using this same command in cmd by invoking powershell i am getting 'Where-Object is not recognized as an internal or external command,operable program or batch file' The command i am running in cmd is as follows :- "powershell Get-WmiObject -Class Win32_UserProfile | Where-Object {$_.LocalPath -eq 'C:\Users\Pela'}" I

Unable to pipe cmdlet objects in cmd

不打扰是莪最后的温柔 提交于 2020-04-30 07:34:40
问题 i am using this powershell command to fetch a particular user profile "Get-WmiObject -Class Win32_UserProfile | Where-Object {$_.LocalPath -eq 'C:\Users\Pela'}" But when i am using this same command in cmd by invoking powershell i am getting 'Where-Object is not recognized as an internal or external command,operable program or batch file' The command i am running in cmd is as follows :- "powershell Get-WmiObject -Class Win32_UserProfile | Where-Object {$_.LocalPath -eq 'C:\Users\Pela'}" I

How do I start a windows 7 console with a newly modified system environment

穿精又带淫゛_ 提交于 2020-04-30 06:57:12
问题 I have written a (very simple) little Python script, and I want to be able to distribute it to friends who have no idea what Python is, nor anything about Windows cmd scripts. So, fundamentally I need to install Python on their systems, followed by installing the required libraries for my script, followed by my script (and appropriate start-up links in their desktop). I have no interest in creating some sophisticated install program. So, I have written a very simple, trivial little cmd script

How to call a batch file that is one level up from the current directory?

你离开我真会死。 提交于 2020-04-23 03:52:14
问题 I'm using a batch file in folder1/folder2/file.bat There is a batch file in parent folder folder1 , that I want to open through file.bat I have tried using: start ..\..\code.bat But this results in an error message, because file couldn't be found. Any ideas? 回答1: You could just: cd.. start Code.bat And that would start code.bat from its own directory 回答2: I want to explain better what should be used with an example as the answers posted up to now work only with current working directory being