Search found 11 matches

by gigaaks
08 Oct 2012 09:37
Forum: DOS Batch Forum
Topic: Xcopy - Invalid drive specification error
Replies: 6
Views: 20424

Re: Xcopy - Invalid drive specification error

Options I was using with Xcopy were: /i /v /y /e /h/ /c /Z and what not but issue was the copy from location (1st param to xcopy was a \\x.x.x.x\x$\xxx\xxx folder location and Xcopy somehow didn't like it so, i had to map this "copy from / source" location. See below. The problem ( authen...
by gigaaks
03 Oct 2012 09:41
Forum: DOS Batch Forum
Topic: Xcopy - Invalid drive specification error
Replies: 6
Views: 20424

Re: Xcopy - Invalid drive specification error

I'm sure that scheduled task won't change directory then run the batch, are you putting the full location to the batch before adding the switches and the locations? Yes, I was. Options I was using with Xcopy were: /i /v /y /e /h/ /c /Z and what not but issue was the copy from location (1st param to...
by gigaaks
03 Oct 2012 08:54
Forum: DOS Batch Forum
Topic: Xcopy - Invalid drive specification error
Replies: 6
Views: 20424

Re: Xcopy - Invalid drive specification error

Yes. Here's the solution. Cause: Somehow When I'm using \\x.x.x.x\drive$\CBTBuilds as the first param, the command works when running from CMD prompt/ or through running .bat from CMD prompt --- BUT NOT, when doing the same exercise through Jenkins (using remcom - remote desktop cmd run utility from...
by gigaaks
02 Oct 2012 20:59
Forum: DOS Batch Forum
Topic: Xcopy - Invalid drive specification error
Replies: 6
Views: 20424

Xcopy - Invalid drive specification error

Xcopy command issue: So far my findings are: 1. I’m on Server: 10.211.18.108 2. Change directory to Folder F:\CBTbuild 3. Script: xcopy_src_dest.bat From Windows command prompt, when I run the script or xcopy command itself with 2 parameters ex: xcopy_src_dest.bat \\10.211.18.115\c$\CBTBUILDS\cbt_0...
by gigaaks
30 Sep 2012 19:29
Forum: DOS Batch Forum
Topic: Xcopy - file copy.
Replies: 1
Views: 2276

Xcopy - file copy.

Hi I want to copy a file from \\serverx.x.x.x\drive$\location\somefile.extension to my local computer. xcopy /v /y \\10.21.21.121\f$\CMBuild\build_05_07_00_235_copy\DB\Upgrade.bat . When I run this command in cmd prompt, it works fine and when I put this line in a .bat file and run the .bat file fro...
by gigaaks
30 Sep 2012 16:59
Forum: DOS Batch Forum
Topic: Replace text in a file - batch script
Replies: 15
Views: 11878

Re: Replace text in a file - batch script

Thanks, actually your solution is good in the sense that it takes care of keywords (can be different) from both files. THanks abc.
by gigaaks
28 Sep 2012 15:25
Forum: DOS Batch Forum
Topic: Replace text in a file - batch script
Replies: 15
Views: 11878

Re: Replace text in a file - batch script

OK this solution is what I did: 1. Install Cygwin on your machine. To get Linux/Unix command funcationality from Windows command prompt. i.e. if you do "ls -ltra", it'll list all the directories/files (including hidden). 2. Create fileA.txt, fileB.txt as mentioned in my post above. 2. Crea...
by gigaaks
28 Sep 2012 14:55
Forum: DOS Batch Forum
Topic: Replace text in a file - batch script
Replies: 15
Views: 11878

Re: Replace text in a file - batch script

This is what I ran after saving the code to "replace.bat" file. F:\TEST_JIM_AKS>replace.bat fileA.txt fileB.txt ":: Block A Start" ":: Block A End" ========================= FileA.txt was: --------------------- line1 line2 :: Block A Start set variable1="C:\ABCD\12...
by gigaaks
28 Sep 2012 14:35
Forum: DOS Batch Forum
Topic: Replace text in a file - batch script
Replies: 15
Views: 11878

Re: Replace text in a file - batch script

Yes. That's correct.

Can you consider the fact that the keyword can contain ", ' , or any characters in it?
by gigaaks
28 Sep 2012 12:35
Forum: DOS Batch Forum
Topic: Replace text in a file - batch script
Replies: 15
Views: 11878

Re: Replace text in a file - batch script

Thanks for replying abc. Well, specifying line# for start n end lines is not a good idea as the file changes frequently, so you can tell whether "Block A start" is now at line# 3 or at 58 as developers can add lines at the top / middle of the file. I can make this ? more easy though. So, i...
by gigaaks
28 Sep 2012 12:00
Forum: DOS Batch Forum
Topic: Replace text in a file - batch script
Replies: 15
Views: 11878

Replace text in a file - batch script

Hi Im new to windows batch scripting so need help urgently I have a "fileA.txt" with the following contents --------------------- line1 line2 :: Block A Start set variable1="C:\ABCD\1234" set variable2="C:\XYZ\6789" set variable3="C:\FFF\5555" SET DB_SERVER=10...