Welcome Guest ( Log In | Register )




                Web Hosting

 
Reply to this topicNew Topic
Get User Input From Vbscript For Batch Files, Get user input from vbscript
netc0n
post Feb 8 2006, 05:35 PM
Post #1


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 5
Joined: 6-February 06
Member No.: 11,120


Hello, I didn't see a tutorial on this subject so i'll go ahead and do it.

Long ago I used batch file programming a quite a bit. I used vbscript files
to get user input for the batch files. So here is a simple example of using the
'call' command to call for the vbscript file which should be in the same folder as the .bat file.

in the batch file pretty much anywhere you can start the vbscript, and call another
.bat file- using @ to of course not echo the line of code -
CODE
@ start /w wscript.exe userin.vbs
@ call ~anyname.bat
@ del ~anyname.bat


now for the .vbs file : create userin.vbs using a text editor such as notepad -
CODE
strUserIn = InputBox("This is the the input box will say")
Set fs = CreateObject("Scripting.FileSystemObject")
strFileName = fs.BuildPath(Wscript.ScriptFullName & "\..", "~anyname.bat")
strFileName = fs.GetAbsolutePathName(strFileName)
Set ts = fs.OpenTextFile(strFileName, 2, True)
ts.WriteLine "set userin=" & strUserIn
ts.Close[code]

Now we use what ever was typed in to execute a command.
So any dos/batch command that makes sense will fit there

[code]@ Batch/doscommand -A %USERIN%


And that is the basic idea of using vbs for batch files.
Go to the top of the page
 
+Quote Post
iGuest
post Mar 20 2008, 08:57 PM
Post #2


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869


question
Get User Input From Vbscript For Batch Files

I search for a thing like this.
I would like to open in a VBS file a custom Windows dialog box to find for a file in my computer (the custom dialog in File -> Open) and pass the path of the file to a BATCH file.
Is it possible ?

-reply by cgialloporpora
Go to the top of the page
 
+Quote Post
iGuest
post Jul 13 2008, 10:44 AM
Post #3


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869


how to transfer data from one folder to another automaticali using vbscript batch file
Get User Input From Vbscript For Batch Files

How to transfer data from one folder to another automaticali using vbscript batch file

-question by shrikant
Go to the top of the page
 
+Quote Post
iGuest
post Dec 3 2008, 07:52 AM
Post #4


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869


ASP Classic validation of user input
Get User Input From Vbscript For Batch Files

I have made a registration form that take the user input I need code to validate it at server side I need urgent help. -question by suman
Go to the top of the page
 
+Quote Post

Reply to this topicNew Topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No New Posts 3 saneax 1,729 Yesterday, 09:36 AM
Last post by: zlatan24
No New Posts   4 tansqrx 1,148 3rd January 2009 - 05:17 AM
Last post by: iG-dyoung
No new   23 WeaponX 7,065 2nd January 2009 - 09:48 AM
Last post by: iG-jagadesh
No new 21 RGF 4,903 31st December 2008 - 07:22 PM
Last post by: Guest
No new   24 NilsC 9,494 29th December 2008 - 04:42 AM
Last post by: iG-Cxc Project
No New Posts   2 TavoxPeru 198 24th December 2008 - 02:24 AM
Last post by: TavoxPeru
No New Posts   15 soleimanian 7,900 13th December 2008 - 12:54 PM
Last post by: tek3D
No New Posts   11 elevenmil 4,777 10th December 2008 - 10:28 AM
Last post by: iG-rakesh
No New Posts   2 TheUnreal 301 5th December 2008 - 05:56 AM
Last post by: xboxrulz
No New Posts   7 indwebdesphs 1,322 1st December 2008 - 12:52 PM
Last post by: iG-biju
No New Posts   4 Vyoma 223 28th November 2008 - 08:51 PM
Last post by: yordan
No New Posts   9 xerxes 873 24th November 2008 - 09:57 PM
Last post by: toby
No New Posts   5 yordan 793 6th November 2008 - 09:52 AM
Last post by: yordan
No New Posts   0 FirefoxRocks 217 6th November 2008 - 01:58 AM
Last post by: FirefoxRocks
No new   22 PureHeart 3,654 6th November 2008 - 12:38 AM
Last post by: Guest