Search found 51 matches

by lalat06bag
02 Oct 2018 09:48
Forum: DOS Batch Forum
Topic: need help in creating a batch script to run a procedure
Replies: 1
Views: 2523

need help in creating a batch script to run a procedure

I want to create a batch script to run a database procedure and give me the results in a flat file. I am using exadata. I want to run the batch from a remote windows server. 1. Below is the procedure sp_analyze_wt.sql CREATE OR REPLACE PROCEDURE x.sp_analyze_x AUTHID DEFINER AS BEGIN dbms_stats.gath...
by lalat06bag
15 Aug 2018 09:46
Forum: DOS Batch Forum
Topic: need help in adding a word at the end of all files
Replies: 3
Views: 2902

need help in adding a word at the end of all files

Hi,

I have few files in a folder. Just want to rename all and add test at the end of the file. Can any one please see this?
existing file name xyz.txt, abc.txt
want to rename as xyz_test.txt, abc_test.txt

Thanks,
by lalat06bag
20 Apr 2018 06:38
Forum: DOS Batch Forum
Topic: Need help in date format
Replies: 2
Views: 2815

Re: Need help in date format

Thank you
by lalat06bag
19 Apr 2018 19:19
Forum: DOS Batch Forum
Topic: Need help in date format
Replies: 2
Views: 2815

Need help in date format

Hi, For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c%%a%%b) Here mydate gives 2018419 which is YYYYMMDD format. I want the date format in YYMMDD. Please see, if this is possible in the above code. I tried below and it works. Set mydate=%date:~-2%%date:~4,2%%date:~7,2% This gives t...
by lalat06bag
06 Apr 2018 09:27
Forum: DOS Batch Forum
Topic: Space in a variable
Replies: 4
Views: 4524

Re: Space in a variable

yeah, I see it now. quoted it and it is now resolved.

Thank you.
by lalat06bag
06 Apr 2018 08:02
Forum: DOS Batch Forum
Topic: Space in a variable
Replies: 4
Views: 4524

Space in a variable

@echo on &setlocal setlocal enableDelayedExpansion If "%computername%" == "DTC" ( SET NS=\\xx SET OPSDIR=!NS!\ProAdmin SET COGDIR=!NS!\CREM ) set "list=%COGDIR%\Config\Copy_Daily_EMTS_Reporting.txt" echo %list% pause Why the list shows a space after cogdir in list? How to remove that space? it shows...
by lalat06bag
05 Apr 2018 22:43
Forum: DOS Batch Forum
Topic: Run a batch with computer name
Replies: 6
Views: 4604

Re: Run a batch with computer name

Thank you!
by lalat06bag
05 Apr 2018 19:44
Forum: DOS Batch Forum
Topic: Run a batch with computer name
Replies: 6
Views: 4604

Re: Run a batch with computer name

Hi,

Never mind pls. It worked.

Please ignore the query.
by lalat06bag
05 Apr 2018 18:29
Forum: DOS Batch Forum
Topic: Run a batch with computer name
Replies: 6
Views: 4604

Re: Run a batch with computer name

With this, computer name shows in upper case. Please see the attachment.

Code: Select all

@echo off
echo %ComputerName%
pause
If "%computername%"=="USER-PC" (

echo  Computer FOUND
goto :eof
)

:eof
Exit
by lalat06bag
05 Apr 2018 14:09
Forum: DOS Batch Forum
Topic: Run a batch with computer name
Replies: 6
Views: 4604

Run a batch with computer name

I want to run another batch file when executed on a particular computer. But below script is not working, please suggest.

Code: Select all

@echo off

If "%computername%"=="DXX" (

echo "Computer FOUND"
pause
goto :eof
)

:eof
Exit
by lalat06bag
14 Feb 2018 14:54
Forum: DOS Batch Forum
Topic: How to replace space in file names
Replies: 3
Views: 3879

Re: How to replace space in file names

Thank you a lot.
by lalat06bag
14 Feb 2018 12:07
Forum: DOS Batch Forum
Topic: How to replace space in file names
Replies: 3
Views: 3879

How to replace space in file names

Hi, I have these files in a folder ab and I want to replace the spaces in the file name to _. XXXX_acc-er-in.pdf xxxx_can mess comp-en-us.pdf dddd_ee_le_ang-er-in.pdf cccc_Rel File ope-in-er.pdf xxx_etiti File ope-in-er.pdf So it would be XXXX_acc-er-in.pdf xxxx_can_mess_comp-en-us.pdf dddd_ee_le_an...
by lalat06bag
10 Feb 2018 16:55
Forum: DOS Batch Forum
Topic: removing dates from filenames
Replies: 8
Views: 7224

Re: Help Me- removing dates from filenames

Another few queries on this code. Here while converting the pdf to txt, i am keeping the required pdfs in a separate folder temporarily "Today_Files" , converting the text to AllTextFiles and finally moving all the text to final folder. In the final folder, there would be the same files with differe...
by lalat06bag
10 Feb 2018 16:29
Forum: DOS Batch Forum
Topic: how to read file name with spaces?
Replies: 5
Views: 4072

Re: how to read file name with spaces?

Thank you. This is perfect.