Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Command Prompt Need To Put Quotes Around File


  • Please log in to reply
3 replies to this topic

#1 stephen1417

stephen1417

  • Members
  • 3 posts
  • OFFLINE
  •  
  • Local time:06:18 AM

Posted 19 August 2007 - 08:54 PM

ok in this script i will use my server as the directery

what i want to do is i need to move from one folder to another (change directery) so i use this commend to put my startinf directery into a text file

cd >cwd.txt

my directery was "K:\stephen\scripts\command copy script"
when i put that into the file it looks like this

K:\stephen\scripts\command copy script

and i need it to look like this with quotations around the directery

"K:\stephen\scripts\command copy script"

is there a way to make a command that will change
K:\stephen\scripts\command copy script
into
"K:\stephen\scripts\command copy script"
if there is please post a reply and your help will be put to good use
thanks and good luck

BC AdBot (Login to Remove)

 


#2 stephen1417

stephen1417
  • Topic Starter

  • Members
  • 3 posts
  • OFFLINE
  •  
  • Local time:06:18 AM

Posted 19 August 2007 - 10:03 PM

ok well i just found out how to do that and the answer for all of you who need to know is
you have to type this in
lets say that i wanted to name the text file i was going to put the starting directery test.txt
what you have to type in is
echo "%cd%" >test.txt
than the current working directery will be in the file test.txt with quotes around the directery name and path

#3 WinCrazy

WinCrazy

  • Members
  • 265 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Ambler, PA USA
  • Local time:05:18 AM

Posted 19 August 2007 - 10:09 PM

Isn't MS batch file language fun ? (cough)

#4 stephen1417

stephen1417
  • Topic Starter

  • Members
  • 3 posts
  • OFFLINE
  •  
  • Local time:06:18 AM

Posted 19 August 2007 - 10:52 PM

well it gets the job done *cough* if you spend endless hours trying to figure it out *cough*




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users