1
vote
1answer
37 views

For in batch has weird behavior while reading folders

Im trying to do a simple batch (it is not the whole thing, but that's the part that is making everything fail) @echo off for /f "tokens=*" %%G in ('dir /s /b /a:d "e:\tmp\*"') do ( echo %%G ...
-1
votes
2answers
82 views

Desktop backups maintenance on a network share

I have configured Windows Backup and Restore function on Windows 7 Professional desktops to make daily backup on a network share placed on a Windows Server 2012. (BTW It's a pity that this utility ...
0
votes
1answer
133 views

Batch script works on Windows 7 but not Windows Server 2008

Good Day Al I have the following batch script that loops through a folder containing .sql files. When it finds a .sql file that has today's date timestamp on it, it copies that file to a new ...
0
votes
1answer
1k views

How to escalate to administrative token in Windows 7 using only CMD.exe [duplicate]

If I am not able to right click on CMD and run as administrator, or CTRL + Shift + Enter to run CMD, but I am using an administrative user account in a non-admin shell (CMD.exe); How in the world do I ...
2
votes
1answer
635 views

Batch - how to copy file by minimum size and date modification?

I have this simple batch script which copies the newest file in some dir to another place. I want this script to also ignore all files (in the DIR command section) under 1GB of size. FOR /F ...
1
vote
1answer
2k views

Detecting a registry key with a space in the path from the CLI (or .bat file)?

I've run into a problem in which my experience (and Google-fu) have let me down. Basically, I need to push out KB968730 to a couple hundred clients or so. Naturally, would like to check for the ...
2
votes
3answers
670 views

Using a for loop in Microsoft cmd.exe, how can I process only the files with a certain extension?

I have a the folder c:\test\ and two files in it a.txt and b.txtv. I would like to process just the files with extension equal to .txt. If I write this commands cd c:\test for %f in (*.txt) do echo ...
1
vote
1answer
1k 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 ...
2
votes
2answers
4k 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
2answers
386 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
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, ...
1
vote
1answer
442 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
520 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?
1
vote
3answers
3k 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
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" \ ...
4
votes
2answers
1k 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> ...
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 > ...
16
votes
13answers
44k views

How to get a list of drive letters on a system through a windows shell (bat, cmd)?

How do I get a list of drive letters and their associated labels on a windows system through a bat file?
11
votes
5answers
3k views

What's the difference between .cmd and .bat files?

Just curious. "Cool" people in our company always use *.cmd while no one was able to explain the difference to me.
5
votes
4answers
4k views

Correct technique to find application in 32 and 64 bit versions of Vista/Windows 7 from CMD.EXE

BACKGROUND I have an existing CMD script that works fine. It launches an app from PROGRAM FILES like so "%PROGRAMFILES%\MyApp\app.exe" PROBLEM it works fine on 32-bit versions of Windows (Vista, ...