|
| Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free! |
need help writing batch file
|
Original Message
|
Name: FRN
Date: November 16, 2000 at 05:53:47 Pacific
Subject: need help writing batch file
|
Comment: Hello everybody.. I have to write a batch file that makes a new directory every day with that day's date (mm/dd/yy) as the directory's name. Then the batch has to ask for files via ftp, including a log-in and a password. Is there a way that I can do that? -- thanks
Report Offensive Message For Removal
|
|
Response Number 1
|
Name: World Library
Date: November 16, 2000 at 12:01:26 Pacific
|
Reply: (edit)Hi, Below is a down and dirty bat to create a dir with todays date. Not pretty, long, and short of foos,comspects, and a bunch of %. Give it a try...it may or may not work on your machine. It's a start. @ECHO OFF IF NOT "%1"=="date" ECHO Program will create a dir with todays date. IF "%3"=="Mon" SET Day=Monday IF "%3"=="Tue" SET Day=Tuesday IF "%3"=="Wed" SET Day=Wednesday IF "%3"=="Thu" SET Day=Thursday IF "%3"=="Fri" SET Day=Friday IF "%3"=="Sat" SET Day=Saturday IF "%3"=="Sun" SET Day=Sunday Set FullDate=%4 goto getdate :start2 echo md %fulldate% > try.bat call try del try.bat goto end :getdate ECHO.|DATE>t.bat CALL t.bat DEL t.bat goto start2 :end echo A directory called %fulldate% has been created.
Report Offensive Follow Up For Removal
|
|
Response Number 2
|
Name: Jon Fox
Date: November 16, 2000 at 12:04:27 Pacific
|
Reply: (edit)I don't know about the second part of your question (the ftp bit) but as for the first there's a program I wrote which will create a directory using that naming scheme, except that the '/' cannot be used for obvious reasons. You can get it from my web site, it's in the command line area and called DATE2FD (date to file or directory). And yes I have spotted the spelling mistake I'll correct it later.
Report Offensive Follow Up For Removal
|
|
Response Number 4
|
Name: World Library
Date: November 16, 2000 at 18:00:57 Pacific
|
Reply: (edit)Hi Fox. That happens to me too. Usually by the time I figure out an answer some one has already posted a reply. Hmmm actually some times it takes me a day just to figure out the question.........lol lol ! Went to your home page....I like it! Fast clean and informative...I also got a copy of your program. I like the three options for different mm/dd/yy hmmmmmmm yes I like those. I always like to see other peoples programs and get their thoughts. There is more than one way to skin a bat. World Library
Report Offensive Follow Up For Removal
|
|
Response Number 5
|
Name: Jill
Date: November 17, 2000 at 08:48:09 Pacific
|
Reply: (edit)You can do anything, but batch files are not really for that purpose, their mainly used for staic file and administration puposes. You could do it easy with a Linix script because Linix has a rich programming system embedded in it. What you want is not a batch file. It's not an intelligent language...
Report Offensive Follow Up For Removal
|
|
Response Number 6
|
Name: Jill
Date: November 17, 2000 at 08:50:32 Pacific
|
Reply: (edit)You can do anything, but batch files are not really for that purpose, their mainly used for staic file and administration puposes. You could do it easy with a Linix script because Linix has a rich programming system embedded in it. What you want is not a batch file. It's not an intelligent language...
Report Offensive Follow Up For Removal
|
|
Response Number 7
|
Name: Jon Fox
Date: November 17, 2000 at 09:12:54 Pacific
|
Reply: (edit)Fox? I've not been called that for a while. I know the feeling about not understanding some of these questions, you get some really odd ones occasionally. Thanks for the comments about my site, it should be getting a bit more informative this weekend. If things go to plan I'll have some new sections uploaded. RE. DATE2FD: I wrote it because people kept asking how to do the same thing in batch. Thought it might be a bit easier to just have a program do it. Then mess around with
Report Offensive Follow Up For Removal
|
|
Response Number 8
|
Name: World Library
Date: November 17, 2000 at 09:50:47 Pacific
|
Reply: (edit)Hi, Dug around in the Library and found a very old password bat. It is in color...has sound...and is mouse orientated..........and it is just a demo so you will need to open it up and make changes to fit your own needs. The password is dobe. You will also find that much of the code can be combined into just one file.......as a demo ( a way to steal....borrow code) it is easier in parts. The file is inside the pic below. Just follow the directions and you can get the zip out of the pic......not a big deal. That should give you code on passwords and directorys. The ftp bat was posted here on the board about a week ago. Off and running . Hope some of this will be of help. W.L.
Report Offensive Follow Up For Removal
|
|
Response Number 9
|
Name: zerostress
Date: November 27, 2000 at 06:30:56 Pacific
|
Reply: (edit)Many persons provided you a solution with the date and directory part so I'll concentrate with the FTP part. 1) If the program run in a DOS shell under Win 9x, get a FTP program with command lines options and scripting (CuteFTP for example). Run CuteFTP from within your batch file. Very easy to do. 2) If you're running a straight DOS machine or can't get your hand on a FTP with CLI or scripting, use a key-faking program (KEYFAKE.COM) to supply the keystrokes to your FTP. Zerostress
Report Offensive Follow Up For Removal
|
|
Response Number 10
|
Name: Phillip
Date: December 22, 2000 at 08:38:10 Pacific
|
Reply: (edit)I need help writing a batch file that will automatically map drives from one shared machine to another or perhaps run a shell script that will ask questions for the user to answer in regards to the machine names and passwords. Currently I am having to run the command net use t: \\sat-2k-(remote name)\c$ /user:sat-2k-(localname)\administrator Can anyone help?
Report Offensive Follow Up For Removal
|
|
Response Number 11
|
Name: karthikeyan
Date: January 17, 2001 at 21:43:51 Pacific
|
Reply: (edit)sir I need to run batch file for the login scripts the scripts are using to map their logical drive(server drive) of users data to respective users while logging in to the network for eg if we use x:\\computer_name\username the folder we are mapping having the name of userid we are using the batch file for each user in order for mapping the drive of server.so that we are in postion to maintain lot of batch files in order to avoid that I need to run a comman batch file for all users to map their respective drives if i get the username in the command prompt who is logging in to the network we can do i think thanking you k.k.karthikeyan
Report Offensive Follow Up For Removal
|
|
Response Number 12
|
Name: edward duggan
Date: January 24, 2001 at 12:26:38 Pacific
|
Reply: (edit)hello i think that this url is a really good idea and useful. anyway i was asked to make a program that takes the results of a ping on the given ip number into the file IPresults.txt please can you help me!!! it is rather important that i get it done.
Report Offensive Follow Up For Removal
|

Post Locked
This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
Go to Disk Operating System Forum Home
|
|
|