Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
3answers
1k views

Transferring files from ftp to local system

I want to copy a file from FTP and paste it to my local system. I want to run this through a batch file. I am trying this for a week. But I couldn't find the solution. Anyone help me please.... This ...
1
vote
1answer
1k views

Delete all files' prefixes with windows cmd

I have a bunch of files with the same prefix "prefix_filename.txt". I want to remove this prefix and underscore from all filenames, how can I do this?
1
vote
1answer
2k views

BAT/CMD to launch a exe multiple times with different parameters without extra bat files

Have a bat that calls a single exe for say 5-10 functions. Is there a way to make the executable run in multiple processes from a bat or cmd? for example: start cmd /k cd Program ...
1
vote
2answers
349 views

Need to sort files by extension and distribute to folders with CMD, VBS, BAT [closed]

Have a Exec that likes to download the internet. Free files and such. Of course its all mixed and in a download directory. I know that one of the admins before me had a script written but took it with ...
0
votes
3answers
642 views

How to make the task scheduler display the cmd shell when invoking a batch file?

I am using Windows 2008 R2, and I am trying to schedule my application in the Task Scheduler. I have created a batch with the right settings. The problem I have is: I need to display the Cmd shell ...
2
votes
1answer
648 views

get windows file modification time

Under Windows, running 'DIR' in the command prompt shows a file's last modified time to the nearest minute. For example: 17.10.2011 14:55 115 638 pgstat.stat How do I get more accurate ...
5
votes
2answers
1k views

Is there a Windows CMD equivalent of Unix shell's exec?

Is there any equivalent in Windows to Unix Shell's "exec"? Basically, I need to avoid forking a new process, so that input/output pipes are preserved, as well as process id. Edit: So, here's my ...
1
vote
1answer
38 views

What's the command-line equivalent of creating a new Partition through MS Windows Server?

For example, When I connect LUNs to a given server, I go into Windows Management, right click on a new disk, and click New Partition. Given Windows CMD prompt, how can I accomplish the same thing ...
2
votes
2answers
6k views

Passing CMD via PSEXEC to a remote computer via .BAT file

Using PSEXEC to call CMD for a DEL command on a remote computer through a batch script. PSEXEC \\hostname -u username -p password CMD /C DEL /Q /F C:\Folder\File.txt The script pauses with a new ...
0
votes
1answer
3k views

How to set env variables and run multiple commands with PsExec?

How can I run multiple commands with PsExec, and how can I export environment variables? I can run two commands by doing the below, but when I try to export an environment variable the second command ...
0
votes
1answer
149 views

Security settings * differences between cmd.exe window and IE

I plan to retrieve an rss file (xml format) with url http://alerts.weather.gov/cap/ma.php?x=0 from a web site periodically with a scheduled task. I have a php script to do that. When I access the ...
5
votes
6answers
2k views

How do I monitor who's logged in?

We in our department are implementing a new admin policy: everyone in a department which we support will receive admin access to their computers. We need to know (while we are performing this "pilot ...
0
votes
1answer
263 views

How to re-save web.config using command prompt

I'm using a simple cmd batch file to deploy my Asp.net MVC web application to server network share. The problem I'm having is that my DLLs can't be simply replaced by new files since existing ones ...
0
votes
2answers
423 views

batch file to strip numbers from filename and pad to two digits

I have a text file with a list of server names (servers.txt) that looks something like this: server1 server2 server3 I have a feeling this can be done with the FOR command as I use that to perform ...
1
vote
1answer
158 views

Unable to issue commands to a remote server when using IP address

I know this is going to sound crazy and I hope that I may just be missing something simple. I am trying to use psexec to restart IIS on a cluster of remote servers. The dept that actually uses the ...
0
votes
1answer
119 views

PowerShell - type no inside every directory and open up notepad2

Do you know the notepad command in PowerShell or cmd.exe? I would like to do the same for NotePad2 I would like to type the following command inside PowerShell and open up the me.txt file; PS ...
3
votes
0answers
779 views

DSGET escapes hash signs (#) in outputted Distinguished Names (DN)s but expects unescaped hash signs for input

Lets say I want to do the very simple query in AD dsquery user -name "John Smith" | dsget user -memberof -expand This will output the DNs of the AD groups that this user belongs to. I can make it ...
1
vote
2answers
2k views

net use mapping not working in batch files but works in cmd

Ok so here's the problem : I've got users using logon script in the domain (username.bat). The script simply lists 4 or 5 (net use letter: \\SERVER\directory\). However, when they open their session, ...
19
votes
4answers
66k views

Get directory containing the currently executed batch script

I use %0 in batch file to get the containing directory of the batch file but the result is :- c:\folder1\folder2\batch.bat I want just directory, without batch file name, like this :- ...
0
votes
1answer
248 views

How to create a windows user from the command line, using a password from a file

Im in a somewhat unique situation. I am trying to create a windows user, using the command line or a batch file. I know how to do that in the basic case: net user username password /add The ...
0
votes
2answers
2k views

Windows Command SC, how to check errorlevel

I'm looking for a way to check the returncode / errorlevel of the SC command in a DOS script. How can I get this information ?
2
votes
1answer
2k views

using git on DOS command line asks for password - but not when using TortoiseGit or gitBash

I would like to use the DOS command line to enter the command: git clone "git_path.git" myDir It asks me to enter a password which I would like to avoid. I usually use TortoiseGit to do all git ...
2
votes
1answer
3k views

What happens when you type Exit in the CMD window on Server Core in an RDP session

I'm getting used to Server Core and I know at some point I am going to type "Exit" in the command window while connected through a remote desktop session. I know that if this is done while connected ...
1
vote
1answer
445 views

more than one start statment in the same batch file?

I wrote the following batch file: start D:\folder1\bin\run.bat start D:\folder2\bin\run.bat start D:\folder3\bin\run.bat start D:\folder4\bin\run.bat It executes the first start but then gives me ...
1
vote
1answer
561 views

Create self extracting (.exe) zip from the command line

Trying to automate a manual procedure in place currently. This is on a Windows 2008 server. Is there a method to create a self extracting (.exe) zip file from a commandline/batch file?
0
votes
2answers
1k views

Escape TAB in cmd.exe?

I need to pass a tab character into a program from the command-line on Windows. eg: grep "foo<TAB>bar" filename However, cmd.exe's auto-completion gets in the way. On Unix, you can hit Ctrl-V ...
1
vote
3answers
4k views

how i can get folder and file name in windows and store it in variable?

i have a folder folder1 contain 3 files file1 , file2 and file3 ... i need command line to do the following task ... store the name of file in variable ... because i want to write dynamic batch
1
vote
3answers
198 views

Where are all the places Windows environment variables set?

When I run cmd.exe and type 'set' I have a %LIB% variable set. The value is pointing to a folder that doesn't exist, which causes warnings during Visual Studio compiles. Here's the thing... If I go ...
5
votes
1answer
5k views

Looking to add the “Log On as a service” right to an account via the command line

I am looking to make a user from the command line with minimal rights to run a service. cmd.exe or powershell.exe are both options, but cmd.exe is preferable. So far I got this: net user /add ...
1
vote
1answer
3k views

Adding a network location via a command prompt?

I'm wondering if it's possible to add a Network Location via the command prompt? This is not a drive letter mapping mind which can be achieved using the net use command.
2
votes
1answer
610 views

print exit code in cmd in windows os

print exit code in cmd in windows os ....some command return exit code ...where this code store...and i want to print this exit code and assign it to variable
2
votes
1answer
1k views

Convert .cmd file into Windows Service - 1053 Error

I have a file "init.cmd" which has the following commands inside it: set APP_ROOT=c:/wamp/www/myproj ringo -b %APP_ROOT%/bin/init.js %APP_ROOT%/app/main.js The file works fine when run from the ...
2
votes
2answers
507 views

Recursive CMD or BAT Windows Script

How can I create a BAT or CMD which will iterate through a folder tree and run same command agaists each folder file? E.g myexe.exe C:\Documents and Settings\folder1\filename.txt myexe.exe ...
3
votes
2answers
1k views

Difference between UnxUtils and GNU CoreUtils

I am a Windows user who wants programs like grep and sed along with other utilities like ls, cut etc in my command prompt. I came across 2 packages which would accomplish this UnxUtils GNU ...
2
votes
3answers
1k views

Executing a long command at the windows xp command prompt

Im using WindowsXP and i want to run the following command: tomcat6 //IS//AlfrescoTomcat --DisplayName="Alfresco Community Edition" \ --Description="Alfresco Tomcat Bundle - Repository and Share" \ ...
0
votes
2answers
36 views

Application running as a service is not able to create the same number of processes as when it runs from cmd

I have a Windows application which creates up to 35 processes and it's working OK when it's running from cmd. But when it is executed as a service on the same machine it is able to create only 20 ...
3
votes
5answers
404 views

windows-server-2003, windows server, download utility from command line , http or ftp or any other protocol , from one command only

I need to know if there is a utility built-in to Windows Server 2003 that I can use from the command line to download a file using only one command. Basically I know that I can download from ftp using ...
5
votes
1answer
5k views

Windows: redirect stdout and stderror to nothing

I have a command I am running produces a ton of output, I want to silence the output without writing to a file. I have used the following to send all output to a file, but again I don't want any file ...
1
vote
5answers
85 views

Copying a chunk of output in Windows 7

I'm wondering how to copy a chunk of output in the command prompt in Windows 7. What I'm ultimately trying to accomplish is when I type "route print" I want to copy the IPs listed under IPv4 Route ...
6
votes
3answers
857 views

How to escape the > sign on Windows command line?

For example, foo -option 10->30 file.ext (this is an actual syntax required) redirects the output to a file named 30. How do I make cmd understand that I would like to pass the actual > character? ...
2
votes
1answer
392 views

Vista cmd shell thinks it's Windows Server 2008 DEBUG

Never seen this before - My vista cmd shell started displaying everything in yellow and outputs the following as soon as I start it: Setting SDK relative to C:/Program Files/Microsoft ...
4
votes
2answers
2k views

Windows Server 2008 - Calling FTP from .CMD - Pass a parameter to an FTP file?

I am calling the following from a .cmd file: ftp -d -s:D:\backup\web-daily.txt The web-daily.txt file is an ftp input file with similar contents to this: open <server> <login> ...
5
votes
11answers
62k views

Windows command prompt: how to get the count of all files in current directory?

What command would you use in cmd.exe to find the number of files in the current directory? Is there a powershell option here? Update: I was hoping to avoid dir, as I know there are 10,000+ files in ...
0
votes
2answers
2k views

Change/Force CMD properties like Window size & Screen Buffer size via GPO, or other ways

Is it possible to control CMD properties like Window size & Screen Buffer size via GPO? (or a VBS script that can be pushed using GPO :) I have Windows 7 / Windows Server 2008. Many thanks for ...
3
votes
2answers
2k views

How to enable ANSI escape codes in Windows cmd?

What is the simplest way to enable ANSI escape codes (eg. colored output) in Windows cmd?
3
votes
1answer
2k views

Get error code of last shell command

Using bash, the exit code of the last thing that executed is stored in the $? shell variable: foo bar echo $? # prints exit code of `bar` baz echo $? # prints exit code of `baz` Is there an ...
14
votes
7answers
24k views

Is there a global, persistent CMD history?

Sometimes I forget how the exact syntax of a CMD command looks and then I would like to search my own CMD history. Clearly, within the same session, you can browse it with the up and down arrow keys ...
0
votes
2answers
1k views

Need relative paths from a batch script directory listing

I have a simple batch script that recursively looks at all files and folders within the directory and writes out the file inventory to a text file. It currently looks like this: dir /b/s > ...
3
votes
2answers
123 views

Visual APP to run CMD commands

I make use of the command prompt quite a bit, but I've noticed that it has really poor support for copying and pasting. Usually I get around this by creating a batch file, then executing that. What ...
0
votes
2answers
1k views

cmd files to hta

I have a lot of cmd files i use daily for example to add users to local groups, installing printers, run as admin tasks etc. I like to take the scripts i use most frequently and add them to a tabbed ...