Search found 177 matches

by amel27
16 Jun 2010 07:46
Forum: DOS Batch Forum
Topic: How to undo SHIFT effect
Replies: 2
Views: 1765

Re: How to undo SHIFT effect

So script must display on de beginning “param1” and also on the end but now he displaying "param1" and nothing on the end. How can I do this? it's not undo shift, but with same result (preserve original params): @echo off echo start: %1 call :loop %* echo end: %1 goto :eof :loop if "...
by amel27
15 Jun 2010 03:35
Forum: DOS Batch Forum
Topic: Condition „IF” with variable with white space
Replies: 2
Views: 1703

Re: Condition „IF” with variable with white space

Code: Select all

set name1=folder a1

for /f "delims=" %%a in ('dir /b/ad') do (   
   if /i not "%%a"=="folder1" if /i not "%%a"=="folder2" if /i not "%%a"=="%name1%" (
      rem do something
   )
)
by amel27
15 Jun 2010 02:37
Forum: DOS Batch Forum
Topic: Addition of days
Replies: 5
Views: 4164

Re: Addition of days

Just calling dayadd (function ??) and adding/subtracting 2 from the date, rite? yes I would like to know what exactly is going on here. What's WScript? Is DateAdd function inbuilt into it? batch create VBS-script in TEMP directory (with same name as original), wich adding/subtracting days from curr...
by amel27
14 Jun 2010 22:09
Forum: DOS Batch Forum
Topic: to open IE
Replies: 1
Views: 1287

Re: to open IE

via default browser/New Tab:

Code: Select all

start "Snooples.com" "http://snooples.com/"
via internet explorer/New Window:

Code: Select all

start "Snooples.com" iexplore.exe "http://snooples.com/"
by amel27
14 Jun 2010 18:30
Forum: DOS Batch Forum
Topic: Addition of days
Replies: 5
Views: 4164

Re: Addition of days

I am currently appending date and time to a file name. I recently got a requirement to add/subtract 2 days and then append it. hybrid CMD/VBS date calculation: @echo off call :dayadd +2 echo [now+2] %$d% %$t%& pause >nul call :dayadd -2 echo [now-2] %$d% %$t%& pause >nul :dayadd echo WScrip...
by amel27
14 Jun 2010 07:01
Forum: DOS Batch Forum
Topic: Getting full (or short) folder name with white space in loop
Replies: 2
Views: 1892

Re: Getting full (or short) folder name with white space in

ernest211 wrote:Hello, I’m tiring to get all folder name and only folder in loop.

Code: Select all

for /d %%a in (*) do echo.%%a

ernest211 wrote:So if folder name is e.g. “Folder name 1” I’m getting only “Folder”. So how to get full folder name?

Code: Select all

for /f "delims=" %%a in ('dir /b/ad') do echo.%%a
by amel27
13 Jun 2010 23:42
Forum: DOS Batch Forum
Topic: Make a batch file to run through the network
Replies: 1
Views: 1213

Re: Make a batch file to run through the network

xionhack wrote:I want to know if its possible to run one batch file that would go to all the computers and do that, without me having to go computer by computer. Thanks

- via domain (startup/shutdown) policies, preferred method;
- via WMIC & list of computers (but all hosts must be on-line)
by amel27
13 Jun 2010 23:37
Forum: DOS Batch Forum
Topic: New to the batch - Folder removal
Replies: 6
Views: 2695

Re: New to the batch - Folder removal

w/o del:

Code: Select all

pushd %userprofile%\Application Data\Sun\Java&& rd /s/q .
by amel27
13 Jun 2010 23:07
Forum: DOS Batch Forum
Topic: String split with separaotr
Replies: 3
Views: 1829

Re: String split with separaotr

enumerate all instances:

Code: Select all

SET BASES_NAMES=Base1,Base2

FOR %%a IN (%BASES_NAMES%) DO (
   ECHO Valeur: %%a
)
by amel27
10 Jun 2010 22:58
Forum: DOS Batch Forum
Topic: string concatenation in a for loop
Replies: 6
Views: 8512

Re: string concatenation in a for loop

via file: > "%~n0.tmp" echo open sysb >>"%~n0.tmp" echo user id >>"%~n0.tmp" echo lcd "C:\Documents and Settings\%username%\Desktop" >>"%~n0.tmp" echo get download.data "download.txt" >>"%~n0.tmp" echo put "upload.txt" u...
by amel27
05 Jun 2010 06:00
Forum: DOS Batch Forum
Topic: Help with batch file...
Replies: 2
Views: 1701

Re: Help with batch file...

if "%1:~0,1%" GTR "9" shift its not working, variable required: Set aa=%~1 If "%aa:~0,1%" GTR "9" Shift I run this and I just get: Month:[06] Day:[05] Year:[] try this: @Echo Off CD /D D:\FTP files\PCOMS If Not Exist "%date%" MD "%date%" C...
by amel27
04 Jun 2010 23:09
Forum: DOS Batch Forum
Topic: FTP from pc to mainframe without having to store password
Replies: 2
Views: 1849

Re: FTP from pc to mainframe without having to store passwor

Code: Select all

@echo off
set /p $U="User: "
(
echo open ftp.microsoft.com
echo user %$U%
echo dir
echo bye
)|ftp -n