batch-file

No longer able to run some commands in CMD - Access is Denied [closed]

≯℡__Kan透↙ 提交于 2020-01-16 08:26:28
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed yesterday . This morning I was able to view all scheduled tasks: > schtasks.exe /query /fo LIST /v and delete scheduled tasks I've created: > Schtasks /delete /TN "taskname" All of the sudden, I get "This app can't run on your PC. To find the version of your PC check with the software publisher" while running same commands. I

Simple ftype command not working

僤鯓⒐⒋嵵緔 提交于 2020-01-16 06:40:42
问题 I am trying to get ftype create a new filetype but it is not working :(. Here is my command: ftype testing="cmd.exe" "%1" but it says File type 'testing' not found or no open command associated with it. I don't know why it is not working, I also followed the documentation mentioned in MSDN. 回答1: Those commands seems not working in Vista or superior. You don't need that anymore. Simply adjust your REGISTRY using REG.EXE command to make associations: REM COMMENT REM THIS IS AN EXAMPLE. CREATE

Python - cxfreeze keeps saying file/directory non-existant

喜你入骨 提交于 2020-01-16 06:12:48
问题 I've got some very basic code which works, and I want to turn it into an exe. Since I'm using Python 3 because it seems so much cleaner than other Python editions, I've not been able to use Py2Exe, so I installed cxfreeze instead. Once I run cxfreeze with the following command: cxfreeze "C:\Users\pc user\Documents\Python\First project\Main.py" It says something about the directory/file not existing. That's about as in-depth as it goes. The exact error is something like "Could not find the

second command in a batch for loop

て烟熏妆下的殇ゞ 提交于 2020-01-16 04:52:06
问题 I want to write a code in batch like the following: for %%a in (%list%) do ( command1 command2 command3 command4 . . . ) The first command for the first element of the list is executed correctly. But in command2 there are errors. In the cmd-window I can see what happend. And in the command isn't changed the %%a to the value. There is a "%a" instead of the value. In my code there is "%%a" exactly like in command1. What is the mistake here? How can I execute more than one command in a batch-for

.BAT file to loop through numbers - Need to add 0 to numbers less than 10

有些话、适合烂在心里 提交于 2020-01-16 04:09:14
问题 I have a number of .bat files that are opening a program and finding a specific instance that is ran everyday. This instance is timestamped and changes everyday. So I am having the .bat file run through everynumber looking for that instance. The format is YYYYMMDDHHMMSS. From this site I already have a .bat file that finds the previous business day. I even have it looping through the numbers The problem is if the number is less than 10, it needs to have a 0 in front of it: 01,02,03,04 etc...

Batch variable inside a variable not working when called

两盒软妹~` 提交于 2020-01-16 01:17:38
问题 Inside Test.txt reads a URL on the first line, theres more but for this it unimportant. setlocal EnableDelayedExpansion set browser=chrome.exe set i=0 for %%f in (Test.txt) do ( set i=0 for /F "delims=" %%l in (%%f) do ( set /A i+=1 set line!i!=%%l )) ::the above read the contents of Test.txt and saved each line to a different Variable made up of two variables set x=0 :ReadLines if %x% gtr %i% ( goto Completed) set /a x+=1 set /a odd=%x%%%2 if %odd%==1 ( set Address=!line%x%! echo !Line%x%! :

Pick a line from text file and set it as variable

谁都会走 提交于 2020-01-16 01:07:13
问题 I really have no idea how to make the result from the following text file in to a variable in my batch file. First I need to run this WMIC line. wmic PAGEFILE get AllocatedBaseSize /Value > test.txt The result from test.txt occupies 6 lines, only the third line has the characters and this is the one I need to set as my variable. Content of test.txt AllocatedBaseSize=16328 回答1: This will directly set the variable without an intermediate file for /f "tokens=*" %%a in ( 'wmic PAGEFILE get

Batch setting a title at the top

笑着哭i 提交于 2020-01-16 00:57:25
问题 How would I set a title to a batch file so it will say My Batch file at the top. thanks if any one can help. I have looked on google but I didn't find any thing of any use. 回答1: Try using this: title "My Batch File" Let me know if that's what you want. 回答2: If this is a normal batch file then either use: title "My Batch File" to see the text appear in the window title bar or use @echo off echo My Batch File @echo on to have it appear inside the CMD prompt window. 回答3: Try this @echo off title

Is this a bug in windows batch?

南笙酒味 提交于 2020-01-16 00:56:11
问题 I have found a peculiar issue with batch scripting that I cannot seem to explain. Maybe its just because I do not know enough about the underpinnings of how batch works but here is an example batch file (test.bat): @echo off FOR /F "tokens=1*" %%i in ("%*") DO ( echo %%j ) if I call it like so: test.bat ab a,b "a,b" I get this as my output: a,b "a b" Why was the second comma stripped out? If I escape the comma like so: test.bat ab a,b "a^,b" I get the correct output: a,b "a,b" It is almost

Batch SetLocal EnableDelayedExpansion and Math problems

…衆ロ難τιáo~ 提交于 2020-01-16 00:54:08
问题 C:\WINDOWS\system32>SetLocal EnableDelayedExpansion C:\WINDOWS\system32>set/a Number1=3+9 12 C:\WINDOWS\system32>if !Number1!==9+3 (echo Good) else (echo Bad) Bad C:\WINDOWS\system32>if !Number1!==3+9 (echo Good) else (echo Bad) Bad C:\WINDOWS\system32>set/a i=9+3 12 C:\WINDOWS\system32>if !Number1!==%i% (echo Good) else (echo Bad) Bad I expected to see the last results (and maybe some others) to show Good as a result but did not! I think this is because it is a error with the SetLocal