Link to home
Start Free TrialLog in
Avatar of ITguy565
ITguy565Flag for United States of America

asked on

Batch scripting question

Batch scripting

Experts,

I have run across an old dos batch script that utilizes something I have never seen.

The script is used to copy a file, but the reasons behind and the uses for the [ ] is what I am looking for.

copy h:filename.txt i:[Spreadsheet]\folder1\folder2

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ITguy565

ASKER

@ste5an,

Please explain and provide an example of that..

For instance
i:\ is mapped to \\domain.com\dfsshare\folder\spreadsheet.

and if I were to run this command.
copy h:filename.txt i:[Spreadsheet]\folder1\folder2

Open in new window


The code Completes successfully. If what you said above was true, this code would fail as it would see the directory path as

i:\spreadsheet\spreadsheet\folder1\folder2 which it does not, it sees it as i:\folder1\folder2.

So riddle me this, what is that [Spreadsheet] and what is the purpose because it doesn't seem to have "Anything" to do with the path.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
EXPERT CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I am not really sure what occurred on that machine, I removed the mapping and remapped the drive and it appears to have resolved whatever issue that individual was having. Upon testing on my personal machine the same code, it performed differently. I have decided to provide everyone who responded points as you were all right.

Thanks,