Tag Info

Hot answers tagged

73

How to remove a forkbomb from the Startup folder? Start your PC in "Safe Mode" (Startup programs do not run in safe mode, and only the basic drivers needed to start Windows are installed). Then you can delete the offending batch file. How To Start Windows Vista in Safe Mode To begin entering Windows Vista Safe Mode, turn on or restart your PC. ...


18

You can skip loading the contents of the Startup folder by holding down Shift as the computer starts and logs in. (Note that this doesn't work for startup applications loaded from the Registry or other locations, only the actual Startup folder.)


9

Try booting your laptop in Safe Mode by pressing F8 during the bootup sequence, from there, just locate the file in your Startup folder and delete it. If you're worried about accidentally opening it, or something similar, you can boot up in Safe Mode with Command Prompt (Provided you can use Command Prompt), and delete it that way, instead. Even safer than ...


6

Your best bet is to boot into Safe Mode or to a recovery disk or a linux live CD and remove it. To boot to Safe Mode go ahead and I believe hit F8. Here's instructions, but the big thing is to strike F8 mid-boot. The command to delete a file in Windows is del and in Linux is rm. Note in Linux you may be better off doing it though their file manager since ...


3

In addition to the other answers: if by some chance, your problem lies in the registry (for instance, as in @isanae's comment on the accepted answer), you can edit the registry offline either by booting to another install of your version of Windows, or by using a setup/WinPE environment CD. In short, open up the registry editor in your alternate OS (from ...


3

You have a couple problems: %var% expansion occurs when the statement is parsed, and the entire parenthesized code block is parsed in one pass, before any commands are executed. So the value is the value that existed before the loop was started. The solution is delayed expansion, which occurs as each command within the loop is being executed. Your logic is ...


3

How do I operate jpegtran on a bunch of images at once? I've not used jpegtran myself before, but based on your example command you can enter the following at a command prompt: cd /path/to/where/images/are/stored for %f in (*.jpg) do jpegtran -copy none -optimize %f %~nf-new.jpg Note that this assumes you are running from cmd.exe command prompt; if you ...


2

You will probably want the START command to initiate parallel processing, though it could be done via WMIC. Note that the first argument is treated as a window title if it is quoted. That is why my first argument is an empty string. The /B option runs the command in the same window. Remove it if you want a new window for each command. There is no simple ...


2

In batch, %~dpn0 returns the Drive, Path and Name of the currently executing script. To do the same in a PowerShell script you can use $MyInvocation.MyCommand.Definition. eg: $scriptPathAndName = $MyInvocation.MyCommand.Definition write-host $scriptPathAndName To get just the path to the script you could use: $scriptPath = split-path -parent ...


2

Although the question specifically mentions Chrome and Firefox, if what you are trying to do is to save the content of each page, wget is made for this task. E.g.: wget --input-file=list_of_urls.txt You can even specify a specific user-agent in case you want the server to see the request as a certain browser: wget ...


1

No idea what would cause the freak-out, sorry, but it's easy enough to restore the services to the states you want them in. The first and easiest way to do this is to take a backup of the service registry keys. Under regedit, go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services and then Export that key as a .REG file (use the File menu or right-click ...


1

How do I control Windows Services from a batch file? for example to enable/disable Services To disable the service: sc stop service_name sc config service_name start= disabled To enable the service: sc config service_name start= auto sc start service_name Syntax SC [\\server] [command] [service_name] [Options] Key server - ...


1

A common scripting language to manage windows systems is PowerShell which ships with all windows versions since Vista. Run it by entering Powershell in your start menu search field. In PowerShell it's easy to start/stop services and it's obvious what you're doing at the same time. You can list all services like this: Get-Service Detailed service ...


1

Sample execution for arguments TEST1 TEST2 TEST3 should be TEST1 (from outer loop) TEST1 (from inner loop) TEST2 (from outer loop) TEST1 (from inner loop) TEST2 (from inner loop) TEST3 (from outer loop) TEST1 (from inner loop) TEST2 (from inner loop) TEST3 (from inner loop) Use the following batch file (test.cmd): @echo off ...


1

Since I'd already started playing, another option. I simplified the formatting, you can adjust that. Instead of trying to use %1,2,3... directly, copies them to X1,2,3... @echo off setlocal setlocal enabledelayedexpansion set N=0 for %%a in (%*) do ( echo %%a outer set /A N=N+1 & set X!N!=%%a for /L %%I in (1,1,!N!) do echo !X%%I! inner ) ...


1

Either go to the root of E: and simply run: DEL /Q *.fem /s or: DEL /Q E:\archive\3 WIP\*.fem /s Note: The /s is key as it traverses all of the subfolders under it. Just run: DEL /? for help in how to use it. if you don't want to do this from a command-line, search out *.fem from Windows Explorer and delete from there.


1

Get the "last" version from a directory of directories An interesting question, since it's Windows batch! dir is your friend here; borrowing from PabloG's answer over on SO: @ECHO OFF FOR /F %%I IN ('DIR *.* /B /O:G-N') DO ECHO %%I & EXIT /B Place in RootFolder named lastversion.bat (or whatever). You can test by invoking from cmd.exe1. Please note ...


1

When the processes finish running the files are empty Your redirect > is redirecting the output of start, instead of the output of Ylp.Web.CmsImportWebJob.exe. In addition the syntax of your start command is incorrect. The first parameter shoud be a "Title" (which is required, not optional). You can remove the start /wait, it is not needed. @echo off ...


1

You can use the following command to create a list of files in Excel from the command prompt dir /A-D /B > yourfilename.csv Replace yourfilename with your preferred file name. This command will create a CSV file (which is editable in Excel). Once you have access to the CSV file you can save it as .xls format when you save it


1

Using >> C:\ProgramData\Tempfolder\test.vbs ECHO if WScript.Arguments.Count <1 then as the example.... If you try this specific line by itself form a command prompt, it will fail with a "The system cannot find the file specified" error. This is because it's reading the <1 as a file input command (opposite of the output >). So you'd have to ...


1

The OptiPNG program shall attempt to optimize PNG files, i.e. reduce their size to a minimum, without losing semantic information. In addition, this program shall perform a suite of auxiliary functions like integrity checks, metadata recovery and pixmap-to-PNG conversion. The optimization attempts are not guaranteed to succeed. Valid PNG files that ...


1

I know that usually enclosing the input with " " is the correct thing to do but it does not work in this case if /i {%ANSWER%}=={help} (goto :FunctionList) When %ANSWER% is New User it contains a Space and is treated as two separate strings by the if command. Solution Enclose the if expressions in "s: if /i "%ANSWER%"=="help" (goto ...


1

/S suppresses the file-not-found prompt (you still get another prompt). You can also use CMD.exe to control window size (and pipe input): cmd.exe /c start /max notepad.exe c:/temp/toto.txt


1

I found I had to adapt soandos powershell method to get this to work as expected (I would have added comment, but not allowed to yet). $files = get-childitem -recurse | % { $_.FullName } foreach ($file in $files) {gzip $file}


1

Use either explorer shell:startup or start "" shell:startup As usual, if the friendly name of a particular Windows Shell Command contains a blank space, enclose it in double quotes, e.g. as follows: start "" "shell:common startup" or explorer "shell:common startup"


1

Why is this not working? 'wmic volume get driveLetter^ where drivertype=2 You have several errors in the above wmic command: drivertype should be drivetype. There is a missing trailing '. The `^ is not needed. The where should come before the get. Not all disk volumes have drive letters (but logical disks do). Use the following batch file: @echo ...


1

On a Microsoft Windows system, you can obtain the current date using the date /t command (the /t option prevents the command from prompting for a change to the the date) or by using echo %date% to display the contents of the date environment variable. However, both of those display the date in the form DDD mm/dd/yyyy, if the system uses a U.S. date format ...


1

The problem is the ^ sign. As an operator it is bitwise-XOR (and not to the power of) or a line-continuation or escape symbol. You can fix the offending line as follows: set /A "Q=(( 1 - ( 1 - A ^ B )) * 100)" or: set /A Q=(( 1 - ( 1 - A ^^ B )) * 100) From your formula I think your are looking for the exponent function and not bitwise-XOR. This ...


1

In your sub-routine runAndAssertCmd line replace %~1 with just %1 as the former removes quotes which you wish to keep.



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