Jump to content

Help with a batch file?


Recommended Posts

I have an idea I'd like to try.

I have a list of files to run a program, and I'd like to make a batch file so when I run the link from the desktop it chooses one random file to run and then launch the app.

This is what I have so far:

@Echo off

echo Launching, please wait...

//Random file selection here

cd ApplicationDir

App.exe

Any ideas? It is about 20 files that I can choose from. I just don't want 20 icons on my desktop, or have to have a separate folder for all the links/files.

Link to comment
Share on other sites


Please could you be more specific as to your requirements!

What is your list of files?

What link?

Launch which app?

<Edit>

What follows is some example code. In order to use it as is, you will need to do the following

  • Create a file, with name and location stipulated in the variable FN_
    This file will contain a line by line listing of your 20ish full filenames

    The extensions of each of those files will need to be registered to an application.

    e.g.
    X:\My Docs\SubDir\MyDoc.rtf

    D:\Shared Folder\Useful Stuff\Commom\AFile.txt

    etc.


Here is the code,
RandFile.cmd
:

@ECHO OFF
SET FN_=C:\DOCUMENTS AND SETTINGS\YOUR_NAME\LISTING.LOG
FOR /F %%? IN ('FIND /C /V "" ^<"%FN_%"') DO SET "LC_=%%?"
SET /A "RD_=%RANDOM% %% LC_ +1"
FOR /F "TOKENS=1* DELIMS=:" %%A IN ('FINDSTR/N "^.*" "%FN_%"') DO (
IF %%A==%RD_% "%%B")

</Edit>

Link to comment
Share on other sites

Thanks for the help. I'm not quite sure how to apply that code to what I need though.

What I did to make it work for now was using the 'Choice' command, I set it up with error levels, and made it so I can simply key in the file I'd like to use, I.E. file set 2, then file number 4, for file 24. and that was working, totaly confirmed on the comp I wrote the batch file for, but now when I transfer it over to the computer I will be using the batch file on, it tells me that 'Choice' is not a recognized command... both computers are Windows XP Pro, SP2. The only differance is the comp I wrote it on was personal Pro, and mine is the older discontinued Corporate (not exactly legit).

Is there something I need to download to make this an option again?

Link to comment
Share on other sites

If you were to provide fuller details, I'd be able to tailor my example better to your requirements.

Just post the 'choice version' of your working batch file here, or if the content is so important that you're afraid someone here may steal from it PM me with it instead.

Windows XP command shell does not have the choice command. And regardless of what some may say, adding a previous version does not work 100% properly.

Link to comment
Share on other sites

Here is a menu template that does not use the choice cmd you will have to fill it in with what you want.

@Echo Off
Title Menu Template
:Main
CLS
Mode 55,15
Color 9A
Echo.
Echo Please Type A Item From The Below List
ECHO ÉÄÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÄ»
ECHO ºÄÄÄÄÄÄÄÄÄÄ Item1 ÄÄÄÄÄÄÄÄÄÄÄÄĺ
ECHO ºÄÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍĺ
ECHO ºÄÄÄÄÄÄÄÄÄÄ Item2 ÄÄÄÄÄÄÄÄÄÄÄÄĺ
ECHO ºÄÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍĺ
ECHO ºÄÄÄÄÄÄÄÄÄÄ Item3 ÄÄÄÄÄÄÄÄÄÄÄÄĺ
ECHO ºÄÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍĺ
ECHO ºÄÄÄÄÄÄÄÄÄÄ Item4 ÄÄÄÄÄÄÄÄÄÄÄÄĺ
ECHO ºÄÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍĺ
ECHO ºÄÄÄÄÄÄÄÄÄÄ Item5 ÄÄÄÄÄÄÄÄÄÄÄÄĺ
ECHO ºÄÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍĺ
ECHO ºÄÄÄÄÄÄÄÄÄÄ Quit ÄÄÄÄÄÄÄÄÄÄÄÄĺ
ECHO ÈÄÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍļ
SET UC=
SET /P UC=Type Your Reply Here-^>
:: /I makes the IF comparison case-insensitive
IF /I '%UC%'=='Item1' GOTO I1
IF /I '%UC%'=='Item2' GOTO I2
IF /I '%UC%'=='Item3' GOTO I3
IF /I '%UC%'=='Item4' GOTO I4
IF /I '%UC%'=='Item5' GOTO I5
IF /I '%UC%'=='Quit' GOTO TheEnd

ClS
color 9b
mode 60,3
echo.
ECHO This reply %UC% is not valid. Please try again.
ping -n 3 127.0.0.1>nul
Goto Main


:I1
CLS
Mode 55,5
Color 9F
Echo.
Echo Menu Item 1 was Selected
ping -n 3 127.0.0.1>nul
Goto Main

:I2
CLS
Mode 55,5
Color F9
Echo.
Echo Menu Item 2 was Selected
ping -n 3 127.0.0.1>nul
Goto Main

:I3
CLS
Mode 55,5
Color 4E
Echo.
Echo Menu Item 3 was Selected
ping -n 3 127.0.0.1>nul
Goto Main

:I4
CLS
Mode 55,5
Color E4
Echo.
Echo Menu Item 4 was Selected
ping -n 3 127.0.0.1>nul
Goto Main

:I5
CLS
Mode 55,5
Color 5F
Echo.
Echo Menu Item 5 was Selected
ping -n 3 127.0.0.1>nul
Goto Main

:TheEnd
Goto EOF
Exit

Link to comment
Share on other sites

@ gun:

nice menu man, can i use it in a project that im working on?

have any idea how i can ask a user to fill in the path to a map on his pc and than use that in my batchfile as destination?

would really like it if you could help?!

damian666 :thumbup

Link to comment
Share on other sites

Yes you can use the menu as I posted it here so other members can use it.

What you want might be better if that was a vbs script.

1:\ Has a user inputbox

2:\ Detects if the inputbox has any text in it

3:\ If there is no text then it ask if you want to redo or quit

4:\ It set up to use Windows Explorer to open up the location

Note

I have also included a line that is commentted out that will run Path\file.

Change this

'/-> Run A File
' Act.Run(FileLocation),1,True

To this

'/-> Run A File
Act.Run(FileLocation),1,True

Saves As Userinput.vbs

Dim Shell : Set Shell = CreateObject("Shell.Application")
Dim Act : Set Act = CreateObject("Wscript.Shell")
X = 0
Do Until X = 1
FileLocation = InputBox("Type in the location of the file")
If FileLocation <> "" Then
X = 1
'/-> Open The Folder Using Windows Explorer
Shell.Explore(FileLocation)
'/-> Run A File
' Act.Run(FileLocation),1,True
Else
ZZ1 = MsgBox("No user Input detected?" & vbCrLf &_
"Did you want to quit or continue" & vbCrLf & "Yes To Continue" &_
vbCrLf & "No to quit" , 4132, "Quit Or Continue")
If ZZ1 = 7 Then X = 1 End If
End If
Loop

Now you can also pass varibles from VBS script to Cmd Promt

Save as userInput_ToCmdPromt.vbs

Dim Shell : Set Shell = CreateObject("Shell.Application")
Dim Act : Set Act = CreateObject("Wscript.Shell")
Dim FileLocation
X = 0
Do Until X = 1
FileLocation = InputBox("Type in the what you want passed as a varible to cmd promt")
If FileLocation <> "" Then
X = 1
'/-> Pass The Varible To Cmd Promt
PassVaribleToCmd()
Else
ZZ1 = MsgBox("No user Input detected?" & vbCrLf &_
"Did you want to quit or continue" & vbCrLf & "Yes To Continue" &_
vbCrLf & "No to quit" , 4132, "Quit Or Continue")
If ZZ1 = 7 Then X = 1 End If
End If
Loop
'/-> Where the user Input get pass to cmd promt
Function PassVaribleToCmd()
Act.Run("%Comspec% /C @Echo Off && CLS && Color 9f && Mode 55,5 && Title Pass Varibles"&_
"Echo. && Echo This Varible Was Passed From The VBS Script &&"&_
"Echo -^>" & FileLocation & " && ping -n 5 127.0.0.1>nul"),1,True
End Function

Link to comment
Share on other sites

ok thanx for that menu man, but i have another question...

how do i pass that path to a batch file or something?

like a"xcopy (that filepath)" "%systemdrive% bla bla"

any ideas?

thanx for the quick reply man.

appriciate it.

damian666 :thumbup

Link to comment
Share on other sites

'/-> Place Where You Want It to Go To
ToHere = "%systemdrive%\bla\bla\"

Save As Vbs_ToXcopy.vbs

Dim Act   : Set Act = CreateObject("Wscript.Shell")
Dim CopyThis, ToHere
'/-> Place Where You Want It to Go To
ToHere = Act.ExpandEnvironmentStrings("%systemdrive% bla bla")
X = 0
Do Until X = 1
CopyThis = InputBox("Type in the what you want passed as a varible to cmd promt")
If CopyThis <> "" Then
X = 1
'/-> Where the user Input get pass to cmd promt
Act.Run("%Comspec% /C @Echo Off && CLS && Color 9f && Mode 55,5 && Title Pass Varibles"&_
"""xcopy ("&CopyThis&")" ""&ToHere&""),1,True
Else
ZZ1 = MsgBox("No user Input detected?" & vbCrLf &_
"Did you want to quit or continue" & vbCrLf & "Yes To Continue" &_
vbCrLf & "No to quit" , 4132, "Quit Or Continue")
If ZZ1 = 7 Then X = 1 End If
End If
Loop

This a uses VBS to copy the file.

I have add some extra lines that will copy a whole folder and it sub folder.

Notes

To Change it from copy a single file to copy a Folder and it sub Folder

Change These Line

'/-> Use This to copy A Single File

CopyThis = InputBox("Type In Ihe File Name And Extention" &_

"That You Want To Copy To Here" & vbCrLf & ToHere)

'/-> Use This to copy A Folder And Sub Folder Uncomment To Make Active

'CopyThis = InputBox("Type In The Folder Path And Name" &_

'"That You Want To Copy To Here" & vbCrLf & ToHere)

'/-> Copies A Single File

Fso.CopyFile(CopyThis),(ToHere),OverWriteExisting

'/-> Copies A Folder And It Sub Folders UnComment To Make Active

' Fso.CopyFolder(CopyThis),(ToHere),OverWriteExisting

To This

'/-> Use This to copy A Single File

'CopyThis = InputBox("Type In Ihe File Name And Extention" &_

'"That You Want To Copy To Here" & vbCrLf & ToHere)

'/-> Use This to copy A Folder And Sub Folder Uncomment To Make Active

CopyThis = InputBox("Type In The Folder Path And Name" &_

"That You Want To Copy To Here" & vbCrLf & ToHere)

'/-> Copies A Single File

' Fso.CopyFile(CopyThis),(ToHere),OverWriteExisting

'/-> Copies A Folder And It Sub Folders UnComment To Make Active

Fso.CopyFolder(CopyThis),(ToHere),OverWriteExisting

Save As Vbs_Copy.vbs

Dim Act : Set Act = CreateObject("Wscript.Shell")
Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Dim CopyThis, ToHere
Const OverWriteExisting=True
'/-> Place Where You Want It to Go To
ToHere = "%systemdrive%\bla\bla\"
X = 0
Do Until X = 1
'/-> Use This to copy A Single File
CopyThis = InputBox("Type In Ihe File Name And Extention" &_
"That You Want To Copy To Here" & vbCrLf & ToHere)
'/-> Use This to copy A Folder And Sub Folder Uncomment To Make Active
'CopyThis = InputBox("Type In The Folder Path And Name" &_
'"That You Want To Copy To Here" & vbCrLf & ToHere)
If CopyThis <> "" Then
X = 1
'/-> Copies A Single File
Fso.CopyFile(CopyThis),(ToHere),OverWriteExisting
'/-> Copies A Folder And It Sub Folders UnComment To Make Active
' Fso.CopyFolder(CopyThis),(ToHere),OverWriteExisting
Else
ZZ1 = MsgBox("No user Input detected?" & vbCrLf &_
"Did you want to quit or continue" & vbCrLf & "Yes To Continue" &_
vbCrLf & "No to quit" , 4132, "Quit Or Continue")
If ZZ1 = 7 Then X = 1 End If
End If
Loop

Link to comment
Share on other sites

nice job man, but maybe i wasnt all that clear.

i made a cmd file to copy files from a I386 dir to a workmap and then i reshack it there and place it back.

the files are in a text filke that the cmd checks to know what files to copy.

but the thing is that everyone has another pc and drive letters and so on.

so is it possible to make something that allows the user to fill in the path to the I386 dir so that the rest of my cmd can perform their task?

i would really appriciate it and will surely name you at the credits when my project is finished!!

best regards damian666

p.s. im a noob at this so please be patient! :blushing:

Link to comment
Share on other sites

I wrote a standalone batch for accepting user input. Its sorta a hackjob done using debug and VBS, but implemented using a single bat file :D

Just copy paste the stuff at the point where you need user input.

@echo off

echo N input.vbs> input.scr
echo E100 77 73 63 72 69 70 74 2E 65 63 68 6F 20 22 73 65>> input.scr
echo E110 74 20 49 6E 70 75 74 3D 22 26 20 77 73 63 72 69>> input.scr
echo E120 70 74 2E 73 74 64 69 6E 2E 72 65 61 64 6C 69 6E>> input.scr
echo E130 65 0D 0A>> input.scr
echo RCX>> input.scr
echo 33>> input.scr
echo W>> input.scr
echo Q>> input.scr
echo >> input.scr

debug < input.scr > nul

echo Please type the path to your i386 folder:
for /f "delims=" %%i in ('cscript //nologo input.vbs') do %%i
echo You choose %Input% as your i386 folder.

del input.scr
del input.vbs

As you can see from the above bat, %Input% contains the user inputted text. Use this variable as many times as you like in the script.

Link to comment
Share on other sites

First of all you should just stick to one language.

You will not need a input for this as the Array holds all the file names.

Place the files names you want to copy in here.

These must be like this "Name Of File" and comma between each

element the last element does not need a comma after it.

hFile = Array("Explorer.exe","Shell32.dll")

This check to make sure the ToHere exists if not it makes the folder.

Save as CopyXpFiles,vbs

Const OverWriteExisting=True
Dim Act : Set Act = CreateObject("Wscript.Shell")
Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Dim WD1 : WD1 = Act.ExpandEnvironmentStrings("%SystemRoot%\")
Dim WD2 : WD2 = Act.ExpandEnvironmentStrings("%SystemRoot%\System32\")
Dim hFile, StrhF,ToHere
'/-> Place Where You Want It to Go To
ToHere = Act.ExpandEnvironmentStrings("%systemdrive%\Shell\")
hFile = Array("Explorer.exe","Shell32.dll")
'/-> Check For Folder Exists
If Not Fso.FolderExists(ToHere) Then Fso.CreateFolder(ToHere) End If
For Each StrhF In hFile
If Fso.FileExists(WD1 & StrhF) Then
Fso.CopyFile(WD1 & StrhF),(ToHere),OverWriteExisting
ElseIf Fso.FileExists(WD2 & StrhF) Then
Fso.CopyFile(WD2 & StrhF),(ToHere),OverWriteExisting
End If
Next

Here is a suggestion have you thought of making a HTA then the user will have a full graphical interface.

Here is the code I have included a rar file of this script. That to make sure there is no errors if you where

to cut and paste it. This makes a HTA with 4 buttons that when pressed will open a message box with a

confirm button pushed.

Code Only For Reference

Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Dim Cnt, Hta, Oms1, Oms2, Sty, Tnp, TS, Var1, Var2
Dim s5 : s5 = Space(4)
Dim V : V = vbCrLf
Tnp = "Transparent"
Oms1 = "OnMouseOver"
Oms2 = "OnMouseOut"
Hta = Fso.GetFile(WScript.ScriptFullName)
Hta = Fso.GetParentFolderName(Hta)
Var1 = Split(Time,":")
If InStr(Var1(2),"AM") Then Var2 = Replace(Var1(2)," AM","") End If
If InStr(Var1(2),"PM") Then Var2 = Replace(Var1(2)," PM","") End If
Hta = Hta & "\NewHta_" & Var2 & ".hta"
Sty = Array(_
s5&" Cursor:Hand;",s5&" Height",s5&" width",s5&" Font-Size" ,s5&" Font-Weight",_
s5&" Font-Family:segoeui,helvetica,verdana,arial;",s5&" Color",_
s5&" BackGround-Color:"&Tnp&";",_
s5&" Filter:progid:DXImageTransform.Microsoft.Gradient",_
s5&" (StartColorStr",",endColorStr",s5&" Margin-Top",s5&" Margin-Bottom",_
s5&" Margin-Left",s5&" Margin-Right",s5&" Padding-Top",s5&" Padding-Bottom",_
s5&" Padding-Left",s5&" Padding-Right",s5&" Text-Align",s5&" Vertical-Align",_
s5&" Border-Top",s5&" Border-Bottom",s5&" Border-Left",s5&" Border-Right")

Set TS = Fso.CreateTextFile(Hta)
TS.WriteLine (_
" <HTML><HEAD><TITLE>New_Hta" &Var2& "</TITLE>" &V&_
" <HTA:APPLICATION ID='Hta" &Var2& "'" &V&_
" SingleInstance='Yes' SysMenu='Yes'" &V&_
" MaximizeButton='No' MinimizeButton='Yes'" &V&_
" SCROLLFLAT ='No' Border='Thin'" &V&_
" BORDERSTYLE ='complex' INNERBORDER ='Yes'" &V&_
" Caption='Yes' WindowState='Normal'" &V&_
" APPLICATIONNAME='Hta" &Var2& "'" &V&_
" Icon='%Windir%\explorer.exe'>" &V& " <STYLE type='text/css'>" &V&_
" Body" &V&s5&"{" &V&_
Sty(3) & ":9.75pt;" &V&_
Sty(4) & ":Bold;" &V&_
Sty(5) &V&_
Sty(6) & ":#203063;" &V&_
Sty(7) &V&_
Sty(8) &V&_
Sty(9) & "='#ece6e0'" & Sty(10) & "='#c0bab4');" &V&_
Sty(11) & ":5;" &V&_
Sty(12) & ":5;" &V&_
Sty(13) & ":2;" &V&_
Sty(14) & ":2;" &V&_
Sty(15) & ":5;" &V&_
Sty(16) & ":5;" &V&_
Sty(17) & ":2;" &V&_
Sty(18) & ":2;" &V&_
Sty(19) & ":Left;" &V&_
Sty(20) & ":Top;" &V&_
Sty(21) & ":2px Solid #d2deca;"&V&_
Sty(22) & ":4px Solid #c6c1ba;" &V&_
Sty(23) & ":2px Solid #c1bdb9;" &V&_
Sty(24) & ":3px Solid #d7d1cb;" &V&s5&"}" &V&_
" .B1" &V&s5&"{" &V&_
Sty(0) &V& Sty(1) & ":16px;" &V& Sty(2) & ":97px;" &V&_
Sty(3) & ":8.05pt;" &V& Sty(4) & ":Bold;" &V& Sty(5) &V&_
Sty(6) & ":#00005a;" &V& Sty(7) &V& Sty(8) &V&_
Sty(9) & "='#ece6e0'" & Sty(10) & "='#c0bab4');" &V&_
Sty(11) & ":1;" &V&_
Sty(12) & ":1;" &V&_
Sty(13) & ":1;" &V&_
Sty(14) & ":1;" &V&_
Sty(15) & ":0;" &V&_
Sty(16) & ":0;" &V&_
Sty(17) & ":0;" &V&_
Sty(18) & ":0;" &V&_
Sty(19) & ":Center;" &V&_
Sty(20) & ":Middle;" &V&_
Sty(21) & ":0px "&Tnp&";" &V&_
Sty(22) & ":0px "&Tnp&";" &V&_
Sty(23) & ":0px "&Tnp&";" &V&_
Sty(24) & ":0px "&Tnp&";" &V&s5&"}" &V&_
" .B2" &V&s5&"{" &V&_
Sty(0) &V& Sty(1) & ":16px;" &V& Sty(2) & ":97px;" &V&_
Sty(3) & ":8.05pt;" &V& Sty(4) & ":Bold;" &V& Sty(5) &V&_
Sty(6) & ":#005a00;" &V& Sty(7) &V& Sty(8) &V&_
Sty(9) & "='#388085'" & Sty(10) & "='#40c0d4');" &V&_
Sty(11) & ":1;" &V&_
Sty(12) & ":1;" &V&_
Sty(13) & ":1;" &V&_
Sty(14) & ":1;" &V&_
Sty(15) & ":0;" &V&_
Sty(16) & ":0;" &V&_
Sty(17) & ":0;" &V&_
Sty(18) & ":0;" &V&_
Sty(19) & ":Center;" &V&_
Sty(20) & ":Middle;" &V&_
Sty(21) & ":0px "&Tnp&";" &V&_
Sty(22) & ":0px "&Tnp&";" &V&_
Sty(23) & ":0px "&Tnp&";" &V&_
Sty(24) & ":0px "&Tnp&";" &V&s5&"}" &V&_
" .TD1" &V&s5&"{" &V&_
Sty(3) & ":8.05pt;" &V&_
Sty(4) & ":Bold;" &V&_
Sty(5) &V&_
Sty(6) & ":#00005a;" &V&_
Sty(7) &V&_
Sty(8) &V&_
Sty(9) & "='LightBlue'" & Sty(10) & "='#00005a');" &V&_
Sty(11) & ":1;" &V&_
Sty(12) & ":1;" &V&_
Sty(13) & ":1;" &V&_
Sty(14) & ":1;" &V&_
Sty(15) & ":1;" &V&_
Sty(16) & ":1;" &V&_
Sty(17) & ":1;" &V&_
Sty(18) & ":1;" &V&_
Sty(19) & ":Center;" &V&_
Sty(20) & ":Middle;" &V&_
Sty(21) & ":0px "&Tnp&";" &V&_
Sty(22) & ":0px "&Tnp&";" &V&_
Sty(23) & ":0px "&Tnp&";" &V&_
Sty(24) & ":0px "&Tnp&";" &V&s5&"}" &V&_
" .TD2" &V&s5&"{" &V&_
Sty(3) & ":8.05pt;" &V&_
Sty(4) & ":Bold;" &V&_
Sty(5) &V&_
Sty(6) & ":#005a00;" &V&_
Sty(7) &V&_
Sty(8) &V&_
Sty(9) & "='LightGreen'" & Sty(10) & "='#005a00');" &V&_
Sty(11) & ":1;" &V&_
Sty(12) & ":1;" &V&_
Sty(13) & ":1;" &V&_
Sty(14) & ":1;" &V&_
Sty(15) & ":1;" &V&_
Sty(16) & ":1;" &V&_
Sty(17) & ":1;" &V&_
Sty(18) & ":1;" &V&_
Sty(19) & ":Center;" &V&_
Sty(20) & ":Middle;" &V&_
Sty(21) & ":0px "&Tnp&";" &V&_
Sty(22) & ":0px "&Tnp&";" &V&_
Sty(23) & ":0px "&Tnp&";" &V&_
Sty(24) & ":0px "&Tnp&";" &V&s5&"}" &V&_
" </STYLE>" &V&_
" <script LANGUAGE='JScript'>window.resizeTo (550,225), window.moveTo (190,175);</SCRIPT>" &V&_
"</HEAD><BODY Scroll='No' BGPROPERTIES='FIXED'>" &V&_
"<CENTER>Template Hta"&Var2&"<TABLE><TD>")
Do Until Cnt = 4
Cnt = Cnt + 1
TS.WriteLine (" <TD Class='TD1'"&Oms1&"='this.className=""TD2""' "&Oms2&"='this.className=""TD1""' >"&V&_
" <INPUT Type='Button' ID='Bttn0"&Cnt&"' Class='B1' Value='Button 0"&Cnt&"'" &V&_
Space(2)& Oms1&"='this.className=""B2""' "&Oms2&"='this.className=""B1""' OnClick='Button0"&Cnt&"()'></TD>"&V&_
Space(2)&"<script LANGUAGE='JScript'>" &V&Space(3)&"function Button0"&Cnt&"()"&V&s5&_
"{alert('Button 0"&Cnt&" Test Reply')}"&V&Space(2)&"</SCRIPT>")
Loop
TS.WriteLine (" </TD></CENTER></TABLE>")
TS.Close

Edited by gunsmokingman
Link to comment
Share on other sites

nice job man, but maybe i wasnt all that clear.

i made a cmd file to copy files from a I386 dir to a workmap and then i reshack it there and place it back.

the files are in a text filke that the cmd checks to know what files to copy.

but the thing is that everyone has another pc and drive letters and so on.

so is it possible to make something that allows the user to fill in the path to the I386 dir so that the rest of my cmd can perform their task?

i would really appriciate it and will surely name you at the credits when my project is finished!!

best regards damian666

p.s. im a noob at this so please be patient! :blushing:

I just remembered that from Win2k onwards, you can do this to directly get user input in a batch file:

SET /P Input=Enter i386 path:

Simple, aint it? :thumbup

Link to comment
Share on other sites

I have an idea I'd like to try.

I have a list of files to run a program, and I'd like to make a batch file so when I run the link from the desktop it chooses one random file to run and then launch the app.

:whistle:
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...